I guess easiest would be creating a global variable LevelUnlocked
and on level one finished set it to 2
on level two finished set it to 3
etcetera
And do a system compare variable to see if levelunlocked higher or equal to 3 to be able to go to level three..
This way you'd only need one global variable to keep track of the user's progress
Ofcourse you'd have to save it to webstorage to make sure when the user exits and restarts the game the progress isn't lost..
I'm sure there are tutorials on unlocking levels in the tutorial section, but these are the basics..