Final Note
Why are JS++ type guarantees necessary? Because, with unsafe JavaScript, even large websites with resources, like GoDaddy, can have broken checkouts resulting in lost sales from a single TypeError:
In the above, the “Continue” button never works so the shopping cart checkout cannot be finished.
Curiously, the checkout failure comes from the same ‘toLowerCase’ method that we explored in Chapter 9. Since JS++ is the only sound, gradually-typed programming language for JavaScript, type guarantees mean more than just adding “types” to JavaScript. It means the types are guaranteed to be correct when you declare them, and there are no edge cases that can result in runtime failures (unlike attempts to add data types by Microsoft and Facebook).
Don’t be the one to break critical code because someone told you to write the code in JavaScript instead. You need more than types and type checking, you need type guarantees.