-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercice22.js
60 lines (55 loc) · 904 Bytes
/
exercice22.js
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
console.log("coucou");
var a = 2;
var b = 3;
var somme = a+b;
console.log(somme);
console.log(a*b);
var client = {"prenom": "Jérôme", "lunettes": false, "type": 3};
console.log(client);
console.log(client["prenom"]);
console.log(client.prenom);
var prenom=client.prenom;
console.log(prenom);
if (client.lunettes==true)
{
console.log("Lunettes");
}
else
{
console.log("Pas lunettes");
}
switch (client.type)
{
case 0:
console.log("ceci est un prospect");
break;
case 1:
console.log("ceci est un client");
break;
case 2:
console.log("ceci est un bon client");
break;
case 3:
console.log("ceci est un ex-client");
break;
}
var i=0;
while(i < 2)
{
console.log("i = "+i);
i++;
}
var j=0;
j++;
console.log("j = "+j);
j--;
console.log("j = "+j);
console.log(j++);
console.log(j);
j+=2;
console.log("j="+j);
j-=5;
console.log("j="+j);
j*=10
console.log("j="+j);
console.log(++j);