-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path51.function-arrow.html
More file actions
43 lines (32 loc) · 847 Bytes
/
51.function-arrow.html
File metadata and controls
43 lines (32 loc) · 847 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Function Arrow</title>
</head>
<body>
<script>
// const sayHello = (name) => {
// const say = `Hello ${name}`;
// console.info(say);
// }
// const sayHello = (name) => console.info(`Hello ${name}`);
const sayHello = name => console.info(`Hello ${name}`);
sayHello("Eko");
// const sum = (first, second) => {
// return first + second;
// }
const sum = (first, second) => first + second;
console.info(sum(100, 100));
function giveMeName(callback){
callback("Eko");
}
// Anonymous Function
// giveMeName(function (name) {
// console.info(`Hello ${name}`);
// })
// Arrow Function
giveMeName(name => console.info(`Hello ${name}`));
</script>
</body>
</html>