-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
49 lines (38 loc) · 964 Bytes
/
main.js
File metadata and controls
49 lines (38 loc) · 964 Bytes
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
let combinedVal = coolFunc(5, 7)
//console.log(combinedVal)
function coolFunc(param1, param2){
let combine = param1+param2;
return combine;
}
const coolFunc2 = function(param1, param2){
let combine = param1+param2;
return combine;
}
let combinedVal2 = coolFunc2(5, 7)
//console.log(combinedVal2)
////////////////////////
function coolFunc3(){
for (let index = 0; index < 3; index++) {
console.log(index);
}
}
let joinedStr ='You read ';
function callback(book){
console.log(`You read ${book}`);
joinedStr += `${book}, `;
}
//callback('running',coolFunc3);
const arr =['The Chosen', 'The Warlock Heretical', 'Where the sidewalk ends','Everybody poops'];
console.log(`You read ${arr.join(", ")}`);
arr.forEach(callback)
for (const book of arr) {
callback(book);
}
console.log(`Joined String: ${joinedStr}`)
let obj = {
name: 'Bob',
func(){
console.log('this',this.name);
}
}
obj.func()