I have that code:
arr = arr.sort(function (a, b) { return a.time>b.time })
Do I need to redefine arr or it is possible just to call
It sorts the array in place (modifying the array). From MDN:
The sort() method sorts the elements of an array in place and returns the array. The sort is not necessarily stable. The default sort order is according to string Unicode code points.