-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
69 lines (42 loc) · 1.08 KB
/
script.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
61
62
63
64
65
66
67
68
let year = 2024
// types primitifs : Number, String, Boolean, Null, Undefined, BigInt, Symbol
// types References : Object, Array, function
console.log(`${typeof year}`)
const myAge = 15
let question = null | undefined
console.log(`Variable question ${question}`)
console.log(myAge)
// erreur d'assignation
// myAge = "DDDD"
// console.log(myAge)
const colors = ["red", "green"]
let savedColors = colors
console.log({
'SavedColors': savedColors
})
colors['0'] = "Yellow"
// error d'assignation
// colors = ['green']
console.log({
'SavedColors': savedColors,
"colors":colors
})
console.log(savedColors === colors)
let colors_two = ["red", "green"]
let saved = colors_two
console.log({
'Saved': saved
})
colors_two = ['indigo']
console.log({
'Saved': saved,
'Colors-two': colors_two
})
console.log(saved === colors_two)
// les truthy : true, les nombres positifs, {}, [], string,
// les falsy : false, 0, les nombres négatifs, null, undefined,"",0n,
if (saved === colors_two){
console.log('Je suis là')
}else{
console.log('Je ne comprends pas')
}