📅  最后修改于: 2022-03-11 15:02:31.036000             🧑  作者: Mango
// day 7 arrays hackerrank solution in javascript
function main() {
const n = parseInt(readLine().trim(), 10);
const arr = readLine().replace(/\s+$/g, '').split(' ').map(arrTemp => parseInt(arrTemp, 10));
let reverseArray =[];
for(let i=arr.length - 1; i>=0; i--){
reverseArray.push(arr[i]);
}
console.log(reverseArray.join(' '));
}