Skip to content

Commit 8d227cd

Browse files
committed
learning multiple possibilities for IF statements
1 parent b0f2d1e commit 8d227cd

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎prep/comparison.js‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
2+
console.log(42 === 32 +10)
13
console.log(42 === 10 + 30)
2-
console.log(42 === 10 + 32)
4+
5+
console.log("hello" === "hello")
6+
7+
console.log("CYF" === "cyf")
8+
9+
const homeTown = "Newcastle"
10+
homeTown === "Liverpool"
11+
console.log(homeTown === homeTown)
12+
13+
console.log(42 === 42)
14+
// Loose equality
15+
42 == "42"

‎prep/errors.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const volunteer = "Shadi";
2+
const volunteer = "Abdi";
3+
// Volunteer has already been declared in the first line, therefore it cannot be declared twice.
4+
const volunteer = "Shadi";
5+
volunteer = "Hinde";
6+
// Volunteer is declared as a const so it cannot be changed.
7+
console.log(Math.round(10.3));
8+
// No close bracket at the end of the console.log

‎prep/greeting.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const greeting = "Hello there";
2+
const name = "Sima"
3+
console.log(`${greeting}, ${name}`);
4+
5+
let greet = "Hi, how are you?"
6+
greet = "Hey there"
7+
console.log(greet)

0 commit comments

Comments
 (0)