Fundamentals
Strings
For the provided string, reverse the order of its' characters;
Examples:
-
abc
becomescba
-
Hello World!
becomes!dlroW olleH
const reverseStr = s => { let ss = ""; for (let i = s.length-1; i >= 0; i--) { ss += s[i]; } return ss; } console.log(reverseStr("Lorem ipsum dolor sit amet!"))
const reverseStr = s => [...s].reverse().join("")- const reverseStr = s => {
- let ss = "";
- for (let i = s.length-1; i >= 0; i--) {
- ss += s[i];
- }
- return ss;
- }
- console.log(reverseStr("Lorem ipsum dolor sit amet!"))