Created
August 1, 2019 15:44
-
-
Save parzibyte/03eb2030822aa8a59f34572ddd701828 to your computer and use it in GitHub Desktop.
Invertir cadena en JS manualmente - https://parzibyte.me/blog/2018/11/18/invertir-cadena-palabra-javascript/
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
/** | |
* Invertir una cadena en JS | |
* @author parzibyte | |
* */ | |
const invertirCadena = cadena => { | |
let nuevaCadena = ""; | |
for (let x = cadena.length - 1; x >= 0; x--) { | |
nuevaCadena += cadena[x]; | |
} | |
return nuevaCadena; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment