Skip to content

Instantly share code, notes, and snippets.

@edrohler
Created March 4, 2016 21:03
Show Gist options
  • Select an option

  • Save edrohler/276180eae493f41fbff3 to your computer and use it in GitHub Desktop.

Select an option

Save edrohler/276180eae493f41fbff3 to your computer and use it in GitHub Desktop.

Revisions

  1. edrohler created this gist Mar 4, 2016.
    9 changes: 9 additions & 0 deletions revArray
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    var myArray = [1, 2, 3, 4, 5];

    function revArray(arr) {
    var nArrr = new Array();
    for (var i = 0; i <= arr.length; i++) {
    nArrr.push(arr[arr.length - i]);
    console.log(nArrr[i]);
    }
    }