Skip to main content

Command Palette

Search for a command to run...

10 Days of HackeRank's challenges -Day 8

Published
1 min read
B

I am a Web developer and a software engineering student of the Faculty of Engineering and Technology (FET) University of Buea. I am interested in innovative projects, open source and anything related to software development

Problem statement: Array reverse

The question requires us to write a function that accepts an array as argument and returns a reverse of the array.

function reverseArray(a){

let newArray=[];

for(let i=a.length-1;i>=0;i--){

newArray.push(a[i])

}

return newArray

}

Here is a link to the questionhttps://www.hackerrank.com/challenges/arrays-ds/problem?isFullScreen=false

https://github.com/Beri28/10-days-of-code/blob/main/dayEight.js