When A is .sorted(), it becomes 6, 7, 8, so those number get new index values, so do the same for B. get current index of the values inside B, then rearrange it based on A’s new arrangement. So when A = 6,7,8, B would be u, z, h
var arrA = [8, 6, 7] // B follows this arr (A)
var arrB = ['h', 'u', 'z'] // B follows A
arrA.sort()
// output: 6, 7, 8
// arrB.followA’s arrangement somehow
// output: u, z, h
arrA.reverse()
// output: 8, 7, 6
// arrB.follow A’s arrangement
// output: h, z, u
console.log(arrA);
console.log(arrB)