Ad
Code
Diff
  • g=w=>w.split('').reverse().join('')
    • g=w=>w?reverseGear(w.substr(1))+w.charAt(0):'';
    • g=w=>w.split('').reverse().join('')
Code
Diff
  • addArr=r=>r.length==0?null:r.reduce((a,c)=>a+c,0)
    • const addArr = (arr) => {
    • let sum = 0;
    • for (let i = 0; i < arr.length; i++) {
    • sum += arr[i];
    • }
    • return sum || null;
    • };
    • addArr=r=>r.length==0?null:r.reduce((a,c)=>a+c,0)