-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path17_aug.js
73 lines (49 loc) · 1.07 KB
/
17_aug.js
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
67
68
69
70
71
// 1234
// 123
// 12
// 1
// 4
// 34
// 234
// 1234
// let n = 4, start;
// for(let row = 0; row < n; row++){
// start = n - row;
// for(let col = 0; col <= row; col++){
// process.stdout.write(start.toString())
// start++;
// }
// console.log("");
// }
// 3
// 23
// 123
// let arr = [3, 4, 12, 34, 36];
// // insert 45 to the end of the array
// arr.push(45);
// console.log(arr);
// // remove the last element of an array ?
// arr.pop();
// console.log(arr);
// let arr1 = arr.slice(2,5);
// console.log(arr1);
// let arr = [1, 34, 56, 23, 45];
// // 67 at postion 2nd => [1, 67, 34, 56, 23, 45]
// arr.push(67);
// // [1, 34, 56, 23, 45, 67]
// // [1, 67,34, 56, 23, 45]
// [1, 34, 56, 23, 45]
// arr[1] = 67
// [1, 67, 56, 23, 45]
// for(let i = arr.length-2; i >= 1; i--){
// arr[i+1] = arr[i];
// }
// arr[1] = 67;
// console.log(arr);
// function expression and function decalartion ?
// const addTwo = (x, y) => x+y;
// console.log(addTwo(2,3));
// curing and argument binding
// function addTwo(x, y){
// return x+y;
// }