Created
June 13, 2024 21:25
-
-
Save pochitax/2b0727ad443fc2a2f6a302ffdec76ad3 to your computer and use it in GitHub Desktop.
ejemplo map
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>ejemplo map</title> | |
</head> | |
<body> | |
<script> | |
let numeros = [1,2,3,4] | |
// el map permite recorrer el arreglo | |
let multiplicar = numeros.map(function(elemento){ | |
return elemento * 3 | |
}); | |
// en este caso imprime en consola | |
// el arreglo multiplicado por 3 | |
console.log(multiplicar); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment