strict mode to the top of a page or function. It can be used to access all of the language’s latest features, and have them work with full performance in modern browsers.
strict mode is what it sounds like — strict. It can be difficult to learn the new variants and rules. Fortunately ES5 offers other modes that can be used that are more accessible to average coder.
Very similar to strict mode. It runs bad code, but tells you all the ways you screwed up and threatens that it won’t run the code next time.
Pretty much let’s you do whatever you want. It’s not happy when you use
`eval`, but doesn’t do anything about it. It will occasionally throw errors, but they are unpredictable and passive aggressive.
`break` have been removed for being too confrontational and replaced with
A new exception is introduced for this mode:
Fit(). When the feeling is the code is given too much lenience, it’s best to:
Writes your code for you while you eat snacks.
This mode also includes new exceptions.
Up() can be used if the code is taken to extreme. There is a special
Party() exception which also returns a special promise. That way you can chain exceptions:
throw Party().then( throw Up(); )
While these new modes are helpful, the TC39 committee realizes they are still to restrictive to be useful is some cases. For ES6, the plan is to release subsections of each from which you can pick and choose. It will be called…
Wait for it…