-
Notifications
You must be signed in to change notification settings - Fork 0
/
exo_data_types.js
35 lines (29 loc) · 953 Bytes
/
exo_data_types.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
// 20 mars 2024 : Data types
let answer = 42;
answer = "hey there!";
console.log(answer);
const array_j = [ 1, 2, 3];
console.log(array_j);
let resultats ; resultats = array_j.map((x) => x*2);
console.log(resultats);
const h = array_j[1];
console.log(h);
if (new Boolean(true)) {
console.log("This log is printed.");
}
if (new Boolean(false)) {
console.log("This log is ALSO printed.");
}
const myFalse = new Boolean(false); // myFalse is a Boolean object (not the primitive value false)
const g = Boolean(myFalse); // g is true
const myString = new String("Hello"); // myString is a String object
const s = Boolean(myString); // s is true
let timestamp = Date.now();
let now = new Date();
let ms = now.getTime();
console.log(ms);
let O = Object.create({a: 1, b: 2});
let p = O.a + O.b;
console.log(p);
let o = { x: "don't change this value" };
library.function(Object.create(o));