Home »
MCQs »
JavaScript MCQs
What is the output of the following JavaScript code? | Question 9
54. What will be the output of the following JavaScript code?
<script>
let str1 = new String("IncludeHelp!");
let str2 = new String("IncludeHelp!");
document.getElementById("test").innerHTML = (str1==str2);
</script>
- true
- false
- True
- False
Answer: B) false
Explanation:
In the above code, str1 and str2 are the objects. And. In the JavaScript, comparison of two objects returns false.