Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 30, 2019 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/16b68ddda4237cc49e9a762cbe56e4d0 to your computer and use it in GitHub Desktop.
Save parzibyte/16b68ddda4237cc49e9a762cbe56e4d0 to your computer and use it in GitHub Desktop.
/**
* Ejemplos y explicación de Array Map
* en JavaScript
*
* https://parzibyte.me/blog
*
*/
const numerosString = ["20", "515", "800"];
const numerosInt = numerosString.map(function(numeroComoString){
return parseInt(numeroComoString);
});
console.log(numerosInt);
/*
Salida:
[ 20, 515, 800 ]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment