Skip to content

Instantly share code, notes, and snippets.

@csaunders
Created May 13, 2011 15:11
Show Gist options
  • Save csaunders/970707 to your computer and use it in GitHub Desktop.
Save csaunders/970707 to your computer and use it in GitHub Desktop.
reverse
function reverse(arr) {
var start = 0, end = arr.length - 1;
while(start < arr){
var tmp = arr[start]
arr[start] = arr[end]
arr[end] = tmp;
++start, --end;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment