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 4 Question 96 Discussion

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

A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named nag is declared and assigned a value on line 03.

What is the value of msg when getAvailableabilityMessage (''newUserName'') is executed and get Availability (''newUserName'') returns true?

Show Suggested Answer Hide Answer
Suggested Answer: B, D

Contribute your Thoughts:

Julio
1 months ago
I bet the developer who wrote this code is the same one who named the variable 'nag'. Talk about a passive-aggressive way to welcome new users!
upvoted 0 times
...
Merlyn
1 months ago
Clearly, the correct answer is D. undefined, because the code doesn't actually return anything. It just declares a variable 'nag' and that's it.
upvoted 0 times
Irma
8 days ago
C: Right, it's important to pay attention to what the code is actually doing.
upvoted 0 times
...
Kendra
14 days ago
B: Oh, I see. The code only declares a variable but doesn't return anything.
upvoted 0 times
...
Daisy
15 days ago
A: The correct answer is D) undefined.
upvoted 0 times
...
...
Jospeh
2 months ago
Haha, 'nag'? Sounds like the developer is trying to annoy the user if the username is available. I'd go with C. 'User-name available'.
upvoted 0 times
Cordelia
5 days ago
Definitely going with C, 'User-name available'. 'nag' does sound annoying though.
upvoted 0 times
...
Beckie
1 months ago
Yeah, 'nag' is not a very friendly variable name. C seems like the most logical choice.
upvoted 0 times
...
Marleen
1 months ago
I agree, 'nag' does sound annoying. I think C is the correct answer.
upvoted 0 times
...
...
Osvaldo
2 months ago
Wait, is 'nag' a variable that's supposed to be returned? This question is a bit confusing. I'm going to go with B. 'newUserName'.
upvoted 0 times
Lauran
28 days ago
I agree, the correct answer is B) 'newUserName'.
upvoted 0 times
...
Marjory
2 months ago
I think 'nag' is not defined in the code, so the value of msg would be 'newUserName'.
upvoted 0 times
...
...
Heike
2 months ago
Hmm, I think the answer is C. 'User-name available' since the code declares a variable 'nag' and assigns it a value on line 3, indicating the username is available.
upvoted 0 times
Alva
1 months ago
Exactly, the code is designed to return that message when the username is available.
upvoted 0 times
...
Mozelle
1 months ago
So, when getAvailableabilityMessage('newUserName') is executed and returns true, the message will be 'User-name available'.
upvoted 0 times
...
Melissa
1 months ago
Yes, that makes sense. The code assigns a value to 'nag' if the username is available.
upvoted 0 times
...
Cyndy
2 months ago
I agree with you, the answer is C. 'User-name available'.
upvoted 0 times
...
...
Cristy
2 months ago
I'm not sure, but I think it makes sense that the message would be 'User-name available' if the username is available.
upvoted 0 times
...
Florinda
3 months ago
I agree with Izetta, because when the username is available, the message should be 'User-name available'.
upvoted 0 times
...
Izetta
3 months ago
I think the answer is C) 'User-name available'.
upvoted 0 times
...

Save Cancel