Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Javascript Developer I Topic 3 Question 81 Discussion

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 81
Topic #: 3
[All Javascript Developer I Questions]

Refer to the code below:

Let str = 'javascript';

Str[0] = 'J';

Str[4] = 'S';

After changing the string indexvalues, the value of str is 'javascript'. What is the reason

for this value:

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Sarina
1 months ago
I tried to change the first letter of 'javascript' to 'J' and the fourth letter to 'S', but all I got was 'javascript'. I guess the string was like 'Nah, you can't touch this!'
upvoted 0 times
Krissy
10 days ago
C) Primitive values are mutable.
upvoted 0 times
...
Youlanda
21 days ago
B) Non-primitive values are immutable.
upvoted 0 times
...
Timmy
22 days ago
A) Non-primitive values are mutable.
upvoted 0 times
...
...
Mariann
1 months ago
D) Primitive values are immutable - got it! Wait, does that mean I can't make my name 'SUPER AWESOME' by changing the letters one by one? Bummer.
upvoted 0 times
Tabetha
2 days ago
D) Primitive values are immutable - got it! Wait, does that mean I can't make my name 'SUPER AWESOME' by changing the letters one by one? Bummer.
upvoted 0 times
...
Candida
6 days ago
B) Non-primitive values are immutable.
upvoted 0 times
...
Cammy
1 months ago
A) Non-primitive values are mutable.
upvoted 0 times
...
...
Marica
2 months ago
Okay, so I was totally convinced it was A) Non-primitive values are mutable, but now I'm second-guessing myself. These JavaScript questions can be tricky!
upvoted 0 times
Cyril
6 days ago
No, that's not correct. It's actually B) Non-primitive values are immutable.
upvoted 0 times
...
Fausto
10 days ago
A) Non-primitive values are mutable.
upvoted 0 times
...
...
Carlton
2 months ago
Ah, I was about to choose C) Primitive values are mutable, but then I remembered that strings are special in JavaScript. Gotta love those language quirks, am I right?
upvoted 0 times
...
Domingo
2 months ago
I'm pretty sure the answer is D) Primitive values are immutable. Strings are primitive data types in JavaScript, so you can't actually modify the individual characters of a string. That's why the value of 'str' didn't change after the attempted changes.
upvoted 0 times
Francisca
28 days ago
User2: Yeah, strings are primitive data types in JavaScript, so you can't change individual characters.
upvoted 0 times
...
Nidia
29 days ago
User1: I think the answer is D) Primitive values are immutable.
upvoted 0 times
...
...
Susy
2 months ago
But what about arrays? Aren't they also non-primitive values but mutable?
upvoted 0 times
...
Leonida
2 months ago
I agree with Broderick. Non-primitive values like strings cannot be changed once they are created.
upvoted 0 times
...
Broderick
3 months ago
I think the answer is B) Non-primitive values are immutable.
upvoted 0 times
...

Save Cancel