Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JAVASCRIPT ARRRAY LOOP BACKWARDS


let reverseArray = Arr=>{
  let pushed =[];
  for(let i = Arr.length -1; i >= 0; i--){
     pushed.push(Arr[i]);
  }
  return pushed
}



const sentence = ['sense.','make', 'all', 'will', 'This'];

 console.log(reverseArray(sentence)) 
// Should print ['This', 'will', 'all', 'make', 'sense.'];
 
PREVIOUS NEXT
Tagged: #JAVASCRIPT #ARRRAY #LOOP #BACKWARDS
ADD COMMENT
Topic
Name
6+5 =