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:

Marica
9 days 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
...
Carlton
11 days 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
15 days 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
...
Susy
21 days ago
But what about arrays? Aren't they also non-primitive values but mutable?
upvoted 0 times
...
Leonida
25 days ago
I agree with Broderick. Non-primitive values like strings cannot be changed once they are created.
upvoted 0 times
...
Broderick
29 days ago
I think the answer is B) Non-primitive values are immutable.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77