MCQs > IT & Programming > JavaScript > Which are true regarding the code below?

JavaScript MCQs

Which of the following statements are true regarding the code below?
<script>
alert("foo" === new String("foo")); // output false
</script>

Answer

Correct Answer: The "===" operator returns true only if they refer to the same object (comparing by reference) and if both the primitive and the object have the same value.

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