What is the return value of msg hen getAvailabilityMessage (“newUserName” ) is executed and getAvailability(“newUserName”) returns false?

Refer to the code snippet:

Function getAvailabilityMessage(item) {

If (getAvailability(item)){

Var msg =”Username available”;

}

Return msg;

}

A developer writes this code to return a message to user attempting to register a new username. If the username is available, variable.

What is the return value of msg hen getAvailabilityMessage (“newUserName” ) is executed and getAvailability(“newUserName”) returns false?
A . “Username available”
B . “newUserName”
C . “Msg is not defined”
D . undefined

Answer: D

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments