Let's consider this scenario:
var currentHistory = ['t1', 't2', 't3', 't4', 't5'];
console.log(currentHistory);
Next, we decide to swap an element and display the array again:
var tmp = currentHistory[2];
currentHistory[2] = currentHistory[0];
currentHistory[0] = tmp;
console.log(currentHistory);
Oddly enough, the output remains unchanged both times.
Array[5] 't3', 't2', 't1', 't4', 't5'
Array[5] 't3', 't2', 't1', 't4', 't5'
This peculiar consistency in results got me thinking deeply last night, seeking a resolution to this mystery. Any insights would be greatly valued.