function reverse (arr) { return arr.length ? [].concat(arr[arr.length - 1], reverse(arr.slice(0, arr.length - 1))) : []; } #140js
@frosas function reverse (arr) { return arr.reduceRight(function (reversed, el) { return reversed.push(el) && reversed; }, []); } // filter?
-
-
@sebinsua oops yes. I didn't know about reduceRight, nice!Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.