MCPcopy Create free account
hub / github.com/JerePrograma/FullStackEgg / textos

Function textos

Etapa4JavaScript/ejercicio18.js:11–37  ·  view source on GitHub ↗
(arreglo)

Source from the content-addressed store, hash-verified

9let palabraLarga = "";
10
11function textos(arreglo) {
12 let suma = 0;
13 let resta = 0;
14 let multi = 1;
15 arreglo.forEach((element) => {
16 if (typeof element == "string") {
17 if (element.length > palabraLarga.length) {
18 palabraLarga = element;
19 }
20 }
21 // if (typeof element == "boolean") {
22 // if (element) {
23 // console.log(element);
24 // } else {
25 // console.log(element);
26 // }
27 // }
28 if (typeof element == "number") {
29 suma += element;
30 resta -= element;
31 multi *= element;
32 }
33 });
34 let div = valores[1] / valores[5];
35 let modulo = valores[1] % valores[5];
36 console.log(suma, resta, multi, div, modulo);
37}
38
39let falso = valores[0] && valores[2];
40let verdadero = valores[0] || valores[2];

Callers 1

ejercicio18.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected