This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function restar (primerNumero, segundoNumero){ | |
| return primerNumero - segundoNumero; | |
| } | |
| function concatenar(palabraUno, palabraDos){ | |
| return palabraUno + " " + palabraDos; | |
| } | |
| function main(){ | |
| const resultado = restar(56, 3); | |
| console.log(resultado); | |
| console.log(concatenar("hola","mundo")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function transformarFrase(frase) { | |
| const fraseMayuscula = frase.map((palabra) => { | |
| const primeraLetra = palabra.charAt(0).toUpperCase(); | |
| const restoPalabra = palabra.slice(1).toLowerCase(); | |
| return primeraLetra + restoPalabra; | |
| }); | |
| const oracion = fraseMayuscula.join(' '); | |
| return oracion; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const jugadorUno = { | |
| nombre: "Marce", | |
| habilidades: { | |
| ataque: 70, | |
| velocidad: 30, | |
| vida: 60, | |
| magia: 120, | |
| }, | |
| articulos: ["espada", "escudo", "varita"], | |
| }; |