-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlet.js
More file actions
28 lines (20 loc) · 706 Bytes
/
let.js
File metadata and controls
28 lines (20 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// COMMAND : node EcmaScript.js
/* “let” keyword was introduced in ES6. It lets you define block scope(bracket scope) variables in JavaScript.
Initially JavaScript only supported function scope and global scope variables.
“let” keyword limits the variables accessibility upto a block, statement or expression.
*/
if(true)
{
let x = 12;
console.log(x); // 12
}
// UnComment this
// console.log(x); // x is not defined
//********************************************************************************************************/
// This is the difference b/w var and let keyword.
if(true)
{
var y= 20;
console.log("The inside is "+ y);
}
console.log("The outside is "+ y);