Skip to content

Commit 2515a68

Browse files
in random errors 1; I explained the problem and suggested using let instead of const.
1 parent 172ac8f commit 2515a68

File tree

1 file changed

+5
-2
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
const age = 33;
44
age = age + 1;
5-
in this code we are trying to reassign the value of age variable by adding 1 to ImageTrack.
5+
in this code we are trying to reassign the value of age variable by adding 1 to ageTrack.
66
However, this will result in an error because the age variable is diclared as a constant using the const keyword.
77
And in javascript, a variable decalred with const cannot be readdigned a new value afteer it has been intialised ,
8-
so if we want to reassign the vlaue we have to use let instead.
8+
so if we want to reassign the vlaue we have to use let instead.
9+
let age = 33;
10+
age = age +1;
11+

0 commit comments

Comments
 (0)