-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoreFunction.js
More file actions
46 lines (36 loc) · 830 Bytes
/
Copy pathmoreFunction.js
File metadata and controls
46 lines (36 loc) · 830 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
// ``는 백틱이라 호칭함
// function printNameAndAge(name, age){
// // 백틱안에 ${변수명} 사용 가능
// console.log(`${name} is ${age} years old`);
// }
//
// printNameAndAge('Hyesung', 23);
// function returnNameAndAge(name, age){
// return `${name} is ${age} years old`;
// }
//
// const hyesung = returnNameAndAge('Hyesung', 23);
//
// console.log(hyesung);
const calcul = {
plus: function(n1, n2){
return n1 + n2;
},
minus: function(n1, n2){
return n1 - n2;
},
multi: function(n1, n2){
return n1 * n2
},
div: function(n1, n2){
return n1 / n2
},
squar: function(n1, n2){
return n1 ** n2
}
};
console.log(calcul.plus(5, 6));
console.log(calcul.minus(7, 5));
console.log(calcul.multi(7, 5));
console.log(calcul.div(7, 5));
console.log(calcul.squar(7, 5));