Skip to content

Commit b9595e1

Browse files
committed
done errors 2.js
1 parent 0fd575d commit b9595e1

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Sprint-1/errors/0.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
// 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?
2+
// We don't want the computer to run these 2 lines - how can we solve this problem?
3+
4+
// To make a multi-line comment in JavaScript, you can start with /* and end with */ . Any text
5+
// in between will be considered a comment and will not be executed as code by the computer.

Sprint-1/errors/1.js

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

3-
// to run this file we need to go in the root and once we are in the file run, node 1.js eg => /Sprint-1/errors node 1.js
3+
// to run this file we need to go in the root and once we are in the file run, node 1.js eg => cd /Sprint-1/errors => ~ node 1.js
44

5-
cost age = 33; // this line is not working because const does not allow you change the data so we can change to let.
6-
age = age + 1;
7-
console.log(age);
5+
6+
// this line is not working because const does not allow you change the data so we can change to let.
7+
// cost age. = 33;
8+
// age = age + 1;
9+
// console.log(age);
810

911

1012
let age = 33;

Sprint-1/errors/2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
33

4-
console.log(`I was born in ${cityOfBirth}`);
4+
55
const cityOfBirth = "Bolton";
6+
console.log(`I was born in ${cityOfBirth}`);
7+
8+
// we just need to move the console.log() to avoid render and expression which was calling the data declared in the variable
9+
//ReferenceError: Cannot access 'cityOfBirth' before initialization

0 commit comments

Comments
 (0)