Hi Paolo, Thanks for the great article.
Akmurat Saktagan

Hello Akmurat.
This is my personal approach.
Please note that this may change while development, as I may find another more suitable way to organize things. There is no absolute truth.
However, this is how I would approach the problem.
I would always have a global state to keep the current level number.

If your levels are completely different in graphics and behaviour, I would build a class for each level. Each with its render function.
A global Javascript object should keep the state of the game, e.g.

const state = {
 currentLevel: 1

and the main render function in index.js would call the desired render function depending on the current level.

If your levels otherwise share logic and graphics I see no need to have classes for each level. Just call a global render function and have classes for common functionalities like Load/Save game, or UI, or AI.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.