This imports the default export with the name GameVariables
. That object is itself not re-assignable, but it doesn't matter: its properties can be changed, so the line GameVariables.score += 100
works as expected, resulting in a total score of 200.
This is a useful technique for managing sets of related variables as their own modules. For example you could use this for "global" variables - which wouldn't actually be in global scope (as they're not actually on the global object), but provides a better organized way to share a set of variables across all your code.
What can be exported
You can export pretty much anything from a script file. However since anything that is imported is read-only (i.e. not re-assignable), it's not very useful to export variables, as they will always work as if they are read-only. Usually modules export objects, functions and classes, as these are the most useful things to share.