forked from mouredev/hello-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02-datatypes.js
More file actions
54 lines (37 loc) · 1022 Bytes
/
02-datatypes.js
File metadata and controls
54 lines (37 loc) · 1022 Bytes
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
/*
Clase 17 - Tipos de datos
*/
// Tipos de datos primitivos
// Cadenas de texto (string)
let myName = "Juan Antonio";
let alias = "jaf";
// Números (number)
let age = 37; // Entero
let height = 1.77; // Decimal
// Booleanos (boolean)
let isTeacher = true;
let isStudent = false;
// Undefined
let undefinedValue;
console.log(undefinedValue);
// Null
let nullValue = null;
// Symbol
let mySymbol = Symbol("mysymbol");
// BigInt
let myBigInt = BigInt(817239871289371986589716389471628379612983761289376129);
let myBigInt2 = 817239871289371986589716389471628379612983761289376129n;
// Mostramos los tipos de datos
console.log(typeof myName);
console.log(typeof alias);
console.log(typeof email);
console.log(typeof age);
console.log(typeof height);
console.log(typeof isTeacher);
console.log(typeof isStudent);
console.log(typeof undefinedValue);
console.log(typeof nullValue);
console.log(typeof mySymbol);
console.log(typeof myBigInt);
console.log(typeof myBigInt2);