Managing state is not a new thing in software, but it’s still relatively new for building software in JavaScript. Traditionally, we’d keep state within the DOM itself or even assign it to a global object in the window….
Source: https://css-tricks.com/build-a-state-management-system-with-vanilla-javascript/