Cyber Monday 2024! 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 1 Question 78 Discussion

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 78
Topic #: 1
[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:

Salley
5 months ago
Option C is kinda sus, don't you think? Substring always trips me up, but I'm going with D to play it safe.
upvoted 0 times
Paulina
5 months ago
I agree with you, I'm going with D as well just to be safe.
upvoted 0 times
...
Filiberto
5 months ago
I think C is correct, it starts at index 1 and goes up to index 5.
upvoted 0 times
...
...
Junita
6 months ago
This is a piece of cake! D is the obvious choice. I bet the exam writer is a Salesforce employee moonlighting as a question creator.
upvoted 0 times
Izetta
5 months ago
D) str.substring (0, 5);
upvoted 0 times
...
Cristy
5 months ago
A) str.substr(1, 5);
upvoted 0 times
...
...
Kathrine
6 months ago
Hmm, I was thinking A would do the trick, but I guess the 'Salesf' is not what we want. Silly me!
upvoted 0 times
Hildred
5 months ago
Yan: Oh, I see. Thanks for clarifying!
upvoted 0 times
...
Yan
5 months ago
Yes, that's correct. It will give us 'Sales'.
upvoted 0 times
...
Sheridan
6 months ago
I think B) str.substr(0, 5) is one of the answers.
upvoted 0 times
...
Nikita
6 months ago
B) str.substr (0, 5);
upvoted 0 times
...
Elroy
6 months ago
A) str.substr(1, 5);
upvoted 0 times
...
...
Oretha
6 months ago
That makes sense to me now. Let's go with B and D.
upvoted 0 times
...
Rebbecca
6 months ago
So, the answers are B and D?
upvoted 0 times
...
Jerlene
6 months ago
B and D both work, but I prefer D because it's more intuitive and readable.
upvoted 0 times
Mitzie
6 months ago
D) str.substring (0, 5);
upvoted 0 times
...
Buddy
6 months ago
I think B is easier to remember.
upvoted 0 times
...
Sherill
6 months ago
I agree, D is definitely more intuitive.
upvoted 0 times
...
Lizbeth
6 months ago
I think B is also a good option, it gives the correct result.
upvoted 0 times
...
Tomas
6 months ago
I agree, D is definitely more intuitive.
upvoted 0 times
...
Gretchen
6 months ago
A) str.substr(1, 5);
upvoted 0 times
...
...
An
7 months ago
For substr, I believe B is right since substr(0, 5) also gives 'Sales'.
upvoted 0 times
...
Marcelle
7 months ago
Option D is the way to go! It's the only one that gives us the 'Sales' substring.
upvoted 0 times
Rory
6 months ago
B) str.substr (0, 5);
upvoted 0 times
...
Ressie
6 months ago
D) str.substring (0, 5);
upvoted 0 times
...
Jettie
7 months ago
B) str.substr (0, 5);
upvoted 0 times
...
Rory
7 months ago
D) str.substring (0, 5);
upvoted 0 times
...
...
Lavina
7 months ago
I think D is correct because substring(0, 5) gets 'Sales'.
upvoted 0 times
...
Leana
7 months ago
Yeah, I'm confused with substr and substring.
upvoted 0 times
...
Oretha
7 months ago
This question is tricky.
upvoted 0 times
...

Save Cancel