Skip to content

Commit 34cf88c

Browse files
committed
1.js
1 parent 65e9285 commit 34cf88c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
This is just an instruction for the first activity - but it is just for human consumption
2-
We don't want the computer to run these 2 lines - how can we solve this problem?
1+
/*This is just an instruction for the first activity - but it is just for human consumption
2+
We don't want the computer to run these 2 lines - how can we solve this problem?
3+
*/

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
// trying to create an age variable and then reassign the value by 1
22

3-
const age = 33;
3+
//const age = 33; // redeclaring with a let or var solves this error
4+
/* variables declared with `const` in JavaScript cannot be reassigned.
5+
However, if the `const` variable is an object or array,
6+
its contents can still be changed (the reference is immutable, not the value).
7+
*/
8+
let age = 33;
49
age = age + 1;
10+
11+
console.log(age);

0 commit comments

Comments
 (0)