Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>The typeof operator returns the type of a variable or expression.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var y = "John";
    var x = + y;
    document.getElementById("demo").innerHTML =
    typeof x + "<br>" + x;
}
</script>

</body>
</html>




Result:
Try it Yourself - © w3schools.com
Privacy Policy