JavaScript Strict Mode

Hoisting a precess in which you can declare a variable after it used. In other words; a variable can be used before it has been declared.

Example of JavaScript Hoisting


Syntax

A regular expression could be defined with the RegExp () constructor, as follows −


<p id="demo"></p>
<script>
x = 6; // Assign 5 to x

elem = document.getElementById("demo"); // Find an element
elem.innerHTML = x;                     // Display x in the element

var x; // Declare x
</script>


                  
        

Output of above code








The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.