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>
  1. true
  2. false
  3. True
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.