Skip to content

Commit 145e443

Browse files
Identify the type error and ensure the type error is fixed.
1 parent 4610def commit 145e443

File tree

1 file changed

+14
-0
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+14
-0
lines changed

Sprint-1/2-mandatory-errors/1.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,17 @@
22

33
const age = 33;
44
age = age + 1;
5+
6+
//TypeError: Assignment to constant variable.
7+
// here we already have a variable constant age=33, now we are trying to reassign the variable constant.
8+
9+
// to enable this work, we can say;
10+
let age = 33;
11+
age = age + 1;
12+
13+
console.log(age); //34
14+
//this will be a way to fix error.
15+
16+
17+
18+

0 commit comments

Comments
 (0)