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 CRT-600 Topic 6 Question 86 Discussion

Actual exam question for Salesforce's CRT-600 exam
Question #: 86
Topic #: 6
[All CRT-600 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:

Youlanda
2 months ago
Haha, this question is a piece of cake! D) is the way to go, no doubt. Substr? More like sub-par in this scenario.
upvoted 0 times
...
Nathan
2 months ago
D) is the obvious choice here. Who wants to deal with those pesky index numbers when you can just use the start and end positions directly?
upvoted 0 times
Selma
23 days ago
C) is not correct, it includes the first character in the substring.
upvoted 0 times
...
Hubert
1 months ago
I agree, D) is the best option for getting 'Sales' from the string.
upvoted 0 times
...
Ashlyn
1 months ago
A) is incorrect, it starts from the second character of the string.
upvoted 0 times
...
Elsa
2 months ago
B) is also a valid choice, it starts from the beginning of the string.
upvoted 0 times
...
...
Felice
2 months ago
Hmm, I was going to say A) and C), but I can see how D) is the better option. Substring just makes more sense for this use case.
upvoted 0 times
...
Gaynell
2 months ago
I agree, D) is the way to go. It's more intuitive and easier to remember than the index-based substr() method.
upvoted 0 times
Merissa
1 months ago
B) str.substr (0, 5);
upvoted 0 times
...
Fabiola
1 months ago
I prefer using substr() method for string manipulation.
upvoted 0 times
...
Lelia
2 months ago
D) str.substring (0, 5);
upvoted 0 times
...
Lemuel
2 months ago
A) str.substr(1, 5);
upvoted 0 times
...
...
Whitley
3 months ago
B) and D) both return 'Sales', but D) is the cleaner and more straightforward solution.
upvoted 0 times
Haydee
2 months ago
D) str.substring (0, 5);
upvoted 0 times
...
Roselle
2 months ago
C) str.substring (1, 5);
upvoted 0 times
...
Kina
2 months ago
B) str.substr (0, 5);
upvoted 0 times
...
Shawnda
2 months ago
A) str.substr(1, 5);
upvoted 0 times
...
...
Serina
3 months ago
I agree with Sueann, because substr starts at the specified index and extracts the specified number of characters.
upvoted 0 times
...
Sueann
3 months ago
I think the answer is A and B.
upvoted 0 times
...

Save Cancel