0

I tried lot of ways to reverse it, but my length of code is 72 or 68 max, which I was able to get. Is there any best way to reduce it further.

//First Function - 67 is the length
reverse=(a)=>{return a.reduceRight((c,b)=>{return c.concat(b)},[])}

//Second trial- 72 

reverse=(a)=>{
var r=[],i=a.length;
while(i-->0){r.push(a.pop())}
 return r}
Vinod kumar G
  • 639
  • 6
  • 17

0 Answers0