Here I have two arrays in javascript code
const array1 = [200, 455.23, -306.5, 9000, -642.21, -133.9, 79.97, 1300];
const array2 = [
'2019-11-18T21:31:17.178Z',
'2019-12-23T07:42:02.383Z',
'2020-01-28T09:15:04.904Z',
'2020-04-01T10:17:24.185Z',
'2022-04-08T14:11:59.604Z',
'2022-04-10T17:01:17.194Z',
'2022-04-11T23:36:17.929Z',
'2022-04-13T10:51:36.790Z',
];
array1.sort((a, b) => a - b);
Here I want array2 to be sorted exactly in the same order by which array1 is sorted. suppose that every element of both arrays at the same index has to be at the same index even after sorting array1. In short, I want to sort one array. And I want the other array sorted in exact same order.