-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathaula02.08.html
More file actions
52 lines (40 loc) · 1.12 KB
/
aula02.08.html
File metadata and controls
52 lines (40 loc) · 1.12 KB
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
<!doctype html>
<html>
<head>
<title>Logica de Programação Javascript</title>
<meta charset="utf-8">
</head>
<body>
<h1>Lógica de programação com Javascript</h1>
</body>
<script>
var nome = prompt('digite seu primeiro nome');
var comprimento = nome.length;
switch(comprimento){
case (1):
alert('oi');
break;
case (2):
alert('ola')
break;
case 3:
alert('teste');
break;
default:
alert('nao deu')
}
var numero = 10;
switch(typeof numero){
case "number":
alert('é numero');
break;
case "string":
alert('é string');
}
if(typeof numero === "number"){
alert('é numero');
} else if(typeof numero === "string"){
alert('é string');
}
</script>
</html>