New Year Sale ! 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 4 Question 96 Discussion

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

Refer to the string below:

const str = 'Salesforce';

Which two statements result in the word 'Sales'?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: B, D

Contribute your Thoughts:

Ilda
3 days ago
I agree with Wilbert, because substr starts at the specified index and extracts a specified number of characters, while substring extracts characters between two specified indices.
upvoted 0 times
...
Chan
4 days ago
I think B) str.substr(0, 5) is the correct answer, as it extracts the substring from the 0th index to the 4th index, which gives us 'Sales'.
upvoted 0 times
...
Wilbert
5 days ago
I think the correct answers are B) and D)
upvoted 0 times
...

Save Cancel