Skip to content

Instantly share code, notes, and snippets.

@caglarorhan
Created February 15, 2018 22:29
Show Gist options
  • Save caglarorhan/d19ef8138a0c949da3bf5b3bf4872543 to your computer and use it in GitHub Desktop.
Save caglarorhan/d19ef8138a0c949da3bf5b3bf4872543 to your computer and use it in GitHub Desktop.
Reverse An Array Just using pop and push
var A = [1,2,3,4,5,6,7,8,9];
A.push(A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop());
console.log(A);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment