Practice ยท 2 of 2
History Navigation Model
Model pushState/replaceState semantics WITHOUT a browser. Write createHistory() returning { push, replace, back, canBack, current } โ current is the latest entry pushed or replaced (null initially); push adds and makes canBack true; replace swaps the top entry WITHOUT changing depth; back moves one entry back and returns it (null at the start).
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: URL & History โ Practice