-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsolved.js
More file actions
59 lines (51 loc) · 1.05 KB
/
solved.js
File metadata and controls
59 lines (51 loc) · 1.05 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
function obtenerPI() {
const PI = 3.14159;
return PI;
}
function obtenerContador() {
let contador = 0;
contador = 5;
return contador;
}
function obtenerNombreCurso() {
const NOMBRE_CURSO = "Fundamentos de JavaScript";
return NOMBRE_CURSO;
}
function reasignarMensaje() {
let mensaje = "hola";
const inicial = mensaje;
mensaje = "adiós";
return { inicial, final: mensaje };
}
function calcularTotal() {
const precioBase = 100;
let descuento = 10;
descuento = 25;
const total = precioBase - descuento;
return { precioBase, descuento, total };
}
function identificarTipos() {
const edad = 25;
const nombre = "JavaScript";
const activo = true;
return {
tipoEdad: typeof edad,
tipoNombre: typeof nombre,
tipoActivo: typeof activo,
};
}
function demostrarHoisting() {
var antes = nombre;
var nombre = "Oscar";
var despues = nombre;
return { antes, despues };
}
module.exports = {
obtenerPI,
obtenerContador,
obtenerNombreCurso,
reasignarMensaje,
calcularTotal,
identificarTipos,
demostrarHoisting,
};