Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 10, 2021 00:33
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/81be529d3217d8b4531d0f7058db2cdc to your computer and use it in GitHub Desktop.
Save parzibyte/81be529d3217d8b4531d0f7058db2cdc to your computer and use it in GitHub Desktop.
const invertirNumeroComoCadena = numero => {
const numeroInvertidoComoCadena = numero.toString().split("").reverse().join("");
// Si quieres puedes hacer un parseFloat() para regresarlo como número y no como cadena
return numeroInvertidoComoCadena;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment