-
Notifications
You must be signed in to change notification settings - Fork 0
/
javascript.html
73 lines (59 loc) · 1.24 KB
/
javascript.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
</head>
<script>
/* let input= confirm("vous etes une personne ?")
alert (input);
function pow(x,n){
result = x;
for(i=1 ; i < n ; i++){
result *= x;
}
return result;
}
let n = +prompt("entrer le nombre ","");
let x = +prompt("entrer l'exposant",'');
if(n<1){
alert('le nombre ' + n + ' n est pas valide')
}else{
alert(pow(x,n));
}
let user = {};
user.name = "john";
user.username = "smith";
uder.name = "pete";
delete user.name;
*/
let saleries = {
john: 100,
Ann: 160,
pete: 130
};
let sum = 0;
for( let kay in saleries){
sum += saleries[key] ;
}
alert (sum);
function multipleNumeric(obj){
for( let key in obj){
if (typeof obj[key] == "number") {
obj[key] *= 2;
}
}
}
</script>
<body>
<div class="menu">
<ul>
<li><a href="autre.html"></a></li>
<li><a href="exo.html"></a></li>
<li><a href="index.html"></a></li>
<li><a href="javascript.html"></a></li>
</ul>
</div>
</body>
</html>