let x; // statement 1 x = 10; // statement 2 document.write(x); // statement 3
Note - Anything written after // considered as a comment, and the text will not be executed.
In above example, the first statement declares a variable, the second statement initializes a value 10 to the variable, and finally using the third statement, the value of x was printed on the document using the document.write() method.
A statement can be called as an instruction of a computer program.
A computer software is a collection of instructions.
<script> let x x = 10 document.write(x) </script>
<script> let x x = 10 document .write(x) </script>
But writing a simple single statement in a single line is recommended to avoid any misunderstanding about the code/statement.
« Previous Tutorial Next Tutorial »
Follow/Like Us on Facebook
Subscribe Us on YouTube