Variable, comment
Let’s find out Variable, comment in JavaScript.
Variable
Variable are containers that hold values when you need to keep them.
It can convert to another value.
Varuables in JavaScript start with ‘var’.
‘var’ means to declear a variable.
1 | var a = 10; |
Variable are able to have number, characters.
Comment
There are two type of comment in JavaScript
- //
1
2var a = 10; // It is comment~!
alert(a + 1);
‘//‘ is able to ignore the characters that follow.
- /*‘/* */‘ is able to ignore the character which they covered code block.
1
2
3
4/*
var a = 10; // It is comment~!
alert(a + 1);
*/