Chapter 7. Serious types
Types, Equality, Conversion and All That Jazz
Itâs time to get serious about our types. One of the great things about JavaScript is you can get a long way without knowing a lot of details of the language. But to truly master the language, get that promotion and get on to the things you really want to do in life, you have to rock at types. Remember what we said way back about JavaScript? That it didnât have the luxury of a silver-spoon, academic, peer-reviewed language definition? Well thatâs true, but the academic life didnât stop Steve Jobs and Bill Gates, and it didnât stop JavaScript either. It does mean that JavaScript doesnât have the... well, the most thought-out type system, and weâll find a few idiosyncrasies along the way. But, donât worry, in this chapter weâre going to nail all that down, and soon youâll be able to avoid all those embarrassing moments with types.
The truth is out there...
Now that youâve had a lot of experience working with JavaScript typesâthereâs your primitives with numbers, strings, and booleans, and thereâs all the objects, some supplied by JavaScript (like the Math object), some supplied by the browser (like the document object), and some youâve written yourselfâarenât you just basking in the glow of JavaScriptâs simple, powerful and consistent type system?
After all what else would you expect ...
Get Head First JavaScript Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.