-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path10.js
More file actions
executable file
·27 lines (22 loc) · 752 Bytes
/
Copy path10.js
File metadata and controls
executable file
·27 lines (22 loc) · 752 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
// Reassign the VAR in VARIABLE_NAME to a new value. ✅
var a = "apple";
a = "ball";
console.log(a); // ball // No Error ✅
var a = "apple";
var a = "applesss";
console.log(a); // applesss // No Error ✅
// ------------------------------------------------------------------
// Reassign the LET in VARIABLE_
let b = "boat";
b = "banana";
console.log(b); // banana // No Error ✅
// let b = "boat";
// let b = "banana";
// console.log(b); // banana // Error - Cannot redeclare b ❌
//------------------------------------------------------------------
// const c = 3.14;
// c = 45;
// console.log(c); // 3.14 // Error - Cannot re-assign c ❌
// const c = 3.1457;
// const c = 65;
// console.log(c); // 3.1457 // Error - Cannot re-assign c ❌