<html>
<body>
<p>Never create strings as objects.</p>
<p>Strings and objects cannot be safely compared.</p>
<p id="demo"></p>
<script>
var x = "John"; // x is a string
var y = new String("John"); // y is an object
document.getElementById("demo").innerHTML = x===y;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_best_object_string1 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 13:23:09 GMT -->
</html>