forked from bethrobson/Head-First-JavaScript-Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaloha.html
More file actions
24 lines (19 loc) · 368 Bytes
/
aloha.html
File metadata and controls
24 lines (19 loc) · 368 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Aloha</title>
<script>
function sayIt(translator) {
var phrase = translator("Hello");
alert(phrase);
}
function hawaiianTranslator(word) {
if (word === "Hello") return "Aloha";
if (word === "Goodbye") return "Aloha";
}
sayIt(hawaiianTranslator);
</script>
</head>
<body> </body>
</html>