Write a function to reverse a array without using sorting function

1.1 Write a function to reverse a array without using sorting function
Hint : (Use array operations push pop)

Kid Asked on December 23, 2015 in Javascript.
Add Comment
  • 1 Answer(s)

      1.1 Reverse Code

       <script type="text/css">
              var numarr = ['1','2','3','4'];
              var cc = [];
              for(i=0; i<numarr.length; i++){
                      cc.unshift(numarr[i]);
               }
              console.log(cc);
      </script>
       

       

      Kid Answered on December 23, 2015.
      Add Comment

      Your Answer

      By posting your answer, you agree to the privacy policy and terms of service.