-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethodTypeAlias.js
More file actions
45 lines (45 loc) · 850 Bytes
/
methodTypeAlias.js
File metadata and controls
45 lines (45 loc) · 850 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
var methodType = function (a) {
return 10;
};
var userInfo = {
name: 'kim',
plusOne: function (a) {
return a + 1;
},
changeName: function () {
console.log("안녕");
}
};
var userInfo2 = {
name: 'hello',
age: 25,
plusOne: function (a) {
return 1;
},
changeName: function () {
console.log('gonichiwa');
}
};
// 콜백함수
function func1(a) {
a();
}
;
function func2() {
}
;
func1(func2); // func2는 콜백함수
var cutZero = function (a) {
if (a[0] === '0')
return a.replace('0', '');
return a;
// let result = a.replace(/^0+/, "");
// return result;
};
var removeDash = function (a) {
return parseFloat(a.replace(/-/g, ""));
};
function func3(a, b, c) {
return c(b(a));
}
console.log(func3('010-1111-2222', cutZero, removeDash));