JSFiddle - React, Tailwind, and code Playground

JavaScript

console.log( "1st", history.length );

location.hash = location.hash + "some-value";

console.log( "2nd", history.length );

setTimeout( function() {

  console.log( "3rd", history.length );

  history.back();

  console.log( "4th", history.length );

}, 1000 );