Answers for "js reverse array of objects"

33

javascript reverse array

var arr = [34, 234, 567, 4];
print(arr);
var new_arr = arr.reverse();
print(new_arr);
Posted by: Guest on November-16-2019
0

how to reverse array of object

var x = [{"score":1},{"score":2},{"score":3}]
console.log(x);

var y = x.reverse();
console.log(y);

if the above method does not work than try this

var y = [...x].reverse();
console.log(y);
Posted by: Guest on June-18-2021
0

js reverse array of objects

var x = [{"score":1},{"score":2},{"score":3}]
console.log(x);
var y = [...x].reverse();
console.log(y);
Posted by: Guest on July-27-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language