Question 21
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.
Which two results occur when running this test on the updated sum3 function? Choose 2 answers
Question 22
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?
Question 23
Given the code below:
let numValue = 1982;
Which three code segments result in a correct conversion from number to string?
Question 24
Refer to the code below:
flag();
function flag() {
console.log('flag');
}
const anotherFlag = () => {
console.log('another flag');
}
anotherFlag();
What is result of the code block?
Question 25
Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?
