Ad
Code
Diff
  • const reverseStr = str => Array.from(str).reverse().join("")
    
    console.log(reverseStr('hello world'));
    • // const reverseStr = str => [...str].reverse().join(''); <-- weak smh
    • function reverseStr(str){return str.split("").reverse().join("")}
    • const reverseStr = str => Array.from(str).reverse().join("")
    • console.log(reverseStr('hello world'));