What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed.
We'd talked through a few simplistic solutions, such as using an array and just treating  index as the top-most window.
I'm wondering if there's any potentially more efficient or useful alternative to what we had brainstormed.
A stack if you want to just close the window on top. A queue if you also need to open windows at the end.
Stack/queue in JS is a simple array, which can be manipulated with