MCQs > IT & Programming > JavaScript > Which is correct values of variable, and why? VariableA = [6,8]; VariableB = [7,9]; variableC = variable + variable;

JavaScript MCQs

Which of the following are correct values of variable, and why?

<script>

VariableA = [6,8];

VariableB = [7,9];

variableC = variable + variable;

</script>

Answer

Correct Answer: 6, 87 and 9. The + operator is not defined for arrays, and it concatenates strings, so it converts the arrays to strings.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it