-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path52.closure.html
More file actions
40 lines (33 loc) · 739 Bytes
/
Copy path52.closure.html
File metadata and controls
40 lines (33 loc) · 739 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Closure</title>
</head>
<body>
<script>
function createAdder(value){
const owner = "Eko";
function add(param){
console.info(owner);
return value + param;
}
return add;
}
const addTwo = createAdder(2);
// function addTwo(param){
// console.info("Eko");
// return 2 + param;
// }
console.info(addTwo(10));
console.info(addTwo(20));
const addTen = createAdder(10);
// function addTwo(param){
// console.info("Eko");
// return 10 + param;
// }
console.info(addTen(10));
console.info(addTen(20));
</script>
</body>
</html>