Today I was solving my first algorithm challenge at FreeCodeCamp and I managed to solve from MDN web docs.
Here is the script:
function reverseString(str) {
var str = str.split('').reverse().join('');
return str;
}
reverseString("hello");
to preserve non-BMP codepoints mixed with unicode code points (emoji, etc).
read here Link
P.S: don't try to do this while your variables are declared as const it won't work :)
Here is the script:
function reverseString(str) {
var str = str.split('').reverse().join('');
return str;
}
reverseString("hello");
to preserve non-BMP codepoints mixed with unicode code points (emoji, etc).
read here Link
P.S: don't try to do this while your variables are declared as const it won't work :)
Comments
Post a Comment