-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
66 lines (54 loc) · 1.02 KB
/
Copy pathapp.js
File metadata and controls
66 lines (54 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// _____Comments_____
// semicolons, single quotes
// console.log()
// Variables
// Functions , arrow functions
// Loops
// Conditionals if else , while , do while, for loop,
// for of , for in, forEach, map, reduce, filter
//Naming standards
// camelCase
// snake_case
// PascalCase
// Debugging
console.log('I am debugging!!');
// Varibles
var myName = 'John';
let location = 'Nairobi';
const career = 'Web development';
// functions
function sayHello() {
console.log('Hello world!!!');
}
sayHello();
const sayHi = () => {
console.log('Hi World!!!');
};
sayHi();
// for loop
for (let i = 0; i < 10; i++) {
console.log(i);
}
// While loop
let j = 1;
while (j < 10) {
console.log(j);
j++;
}
// Conditionals-
// If statements
if (1 < 2) {
console.log('Less than two!!');
}
if (6 > 2) {
console.log('Greater than two!!!');
} else {
console.log('Less than two!!!');
}
if (4 > 9) {
console.log('less than nine');
} else if (4 < 9) {
console.log('Less than nine');
} else {
console.log('Does not meet the condition');
}