-
Notifications
You must be signed in to change notification settings - Fork 346
/
Copy pathtypes.html
56 lines (50 loc) · 1015 Bytes
/
types.html
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
47
48
49
50
51
52
53
54
55
56
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Types</title>
<script>
function lieDetectorTest() {
var lies = 0;
var stolenDiamond = { };
if (stolenDiamond) {
console.log("You stole the diamond");
lies++;
}
var car = {
keysInPocket: null
};
if (car.keysInPocket) {
console.log("Uh oh, guess you stole the car!");
lies++;
}
if (car.emptyGasTank) {
console.log("You drove the car after you stole it!");
lies++;
}
var foundYouAtTheCrimeScene = [ ];
if (foundYouAtTheCrimeScene) {
console.log("A sure sign of guilt");
lies++;
}
if (foundYouAtTheCrimeScene[0]) {
console.log("Caught with a stolen item!");
lies++;
}
var yourName = " ";
if (yourName) {
console.log("Guess you lied about your name");
lies++;
}
return lies;
}
var numberOfLies = lieDetectorTest();
console.log("You told " + numberOfLies + " lies!");
if (numberOfLies >= 3) {
console.log("Guilty as charged");
}
</script>
</head>
<body>
</body>
</html>