history.pushState(null, null, "-1"); for (var i = 0; i < 3; ++i) { console.log(i); history.replaceState(null, null, i); }