-
Notifications
You must be signed in to change notification settings - Fork 1
/
codeFromBiztocredit.js
149 lines (59 loc) · 1.25 KB
/
codeFromBiztocredit.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
let, const, var
----------------------
function print() {
var a = 2000;
let b = 100;
const c = 150;
}
print();
console.log(a); // a is not define
console.log(b); // b is not define
console.log(c); // c is not define
---------------------------
let a = [1,2,3,4];
let b = a;
b[1] = 200;
console.log(a);
console.log(b);
// a = [1,200,3,4]
// b = [1,200,3,4]
------------------------------
const arrayFun = ()=>{
}
--------------------------------------
let str = 'hello everyone';
// { h:1, e:4, l:2, ... }
const countStr = (str) =>{
let strObj = {}
for(let i=0; i< str.length; i++){
if(strObj[str[i]]){
strObj[str[i]] = + strObj[str[i]];
}else{
strObj[str[i]] = 1;
}
}
return str;
}
console.log(countStr(str));
------------------------------------------
Node Module Wrapper Function
package.json
//package-lock.json
name: "^1.2.3"
name: "~1.2.3"
-------------------------------------------
let print = () => {
console.log('Hello!!');
}
route.use(print)
route.post('/', (res, req, next){
next()
})
------------------------------------------
console.log(1);
setTimeout(() => {
console.log(2);
}, 0);
console.log(3);
//1,3,2
//1 2 3