forked from mouredev/hello-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03-beginner-exercises.js
More file actions
160 lines (144 loc) · 3.44 KB
/
03-beginner-exercises.js
File metadata and controls
160 lines (144 loc) · 3.44 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
Clase 18 - Ejercicios: primeros pasos
Vídeo: https://youtu.be/1glVfFxj8a4?t=4733
*/
// 1. Escribe un comentario en una línea
//R= Comentario de una sola linea
// 2. Escribe un comentario en varias líneas
/*
Este es un comentaria
de
varias lineas
jejejej
*/
// 3. Declara variables con valores asociados a todos los datos de tipo primitivos
//String
let myName = "Alan"
//Number
let myAge = 22
//Booleano
let isProgrammer = true
//Symbol
let oneSymbol = Symbol("thisSymbol")
//Undefine
let thisUndefine
// Null
let thisNull = null
//BigInt
let thisBigInt = BigInt(128319219381237139121392n)
let thisBigIntv2 = 128319219381237139121392n
// 4. Imprime por consola el valor de todas las variables
console.log(myName)
console.log(myAge)
console.log(isProgrammer)
console.log(oneSymbol)
console.log(thisUndefine)
console.log(thisNull)
console.log(thisBigInt)
console.log(thisBigIntv2)
// 5. Imprime pocnoa el tipo de todas las variables
console.log(typeof myName)
console.log(typeof myAge)
console.log(typeof isProgrammer)
console.log(typeof oneSymbol)
console.log(typeof thisUndefine)
console.log(typeof thisNull)
console.log(typeof thisBigInt)
console.log(typeof thisBigIntv2)
// 6. A continuación, modifica los valores de las variables por otros del mismo tipo
//String
myName = "Alexis"
//Number
myAge = 23
//Booleano
isProgrammer = false
//Symbol
oneSymbol = Symbol("theSymbolIsNone")
//Undefine
thisUndefine
// Null
thisNull = null
//BigInt
thisBigInt = BigInt(1283192193812371391213921241321n)
thisBigIntv2 = 128319219381237139121392123131231n
console.log(myName)
console.log(myAge)
console.log(isProgrammer)
console.log(oneSymbol)
console.log(thisUndefine)
console.log(thisNull)
console.log(thisBigInt)
console.log(thisBigIntv2)
// 7. A continuación, modifica los valores de las variables por otros de distinto tipo
myName = 24
//Number
myAge = false
//Booleano
isProgrammer = "Alexis"
//Symbol
oneSymbol = null
//Undefine
thisUndefine = BigInt(21321312312312)
// Null
thisNull
//BigInt
thisBigInt = Symbol("this_Symbol")
console.log(myName)
console.log(myAge)
console.log(isProgrammer)
console.log(oneSymbol)
console.log(thisUndefine)
console.log(thisNull)
console.log(thisBigInt)
console.log(thisBigIntv2)
// 8. Declara constantes con valores asociados a todos los tipos de datos primitivos
//String
const myName1 = "Alan"
//Number
const myAge1 = 22
//Booleano
const isProgrammer1 = true
//Symbol
const oneSymbol1 = Symbol("thisSymbol")
//Undefine
//const thisUndefine1
// Null
const thisNull1 = null
//BigInt
const thisBigInt1 = BigInt(128319219381237139121392n)
const thisBigIntv2_1 = 128319219381237139121392n
console.log(myName1)
console.log(myAge1)
console.log(isProgrammer1)
console.log(oneSymbol1)
//console.log(thisUndefine1)
console.log(thisNull1)
console.log(thisBigInt1)
console.log(thisBigIntv2_1)
// 9. A continuación, modifica los valores de las constantes
/*
//String
const myName1 = "Alexis"
//Number
const myAge1 = 26
//Booleano
const isProgrammer1 = false
//Symbol
const oneSymbol1 = Symbol("ourSymbols")
//Undefine
const thisUndefine1
// Null
const thisNull1 = null
//BigInt
const thisBigInt1 = BigInt(128319219381237139121392123132131n)
const thisBigIntv2_1 = 12831921938123713912139212313121n
console.log(myName1)
console.log(myAge1)
console.log(isProgrammer1)
console.log(oneSymbol1)
console.log(thisUndefine1)
console.log(thisNull1)
console.log(thisBigInt1)
console.log(thisBigIntv2_1)
*/
// 10. Comenta las líneas que produzcan algún tipo de error al ejecutarse