What's the point of wrapping an entire code block within two curly braces? For example within .js file:
{
const firstVar;
class firstClass {}
class secondClass {}
}
Is this to create a blockscope and keep the global name space clean? Is it comparable to wrapping an entire javascript module within a self invoking function for example?
Take a look at this JS file for example;
https://github.com/codrops/PageFlipLayout/blob/master/js/demo.js