Skip to Content
Head First JavaScript Programming
book

Head First JavaScript Programming

by Eric T. Freeman, Elisabeth Robson
March 2014
Beginner
704 pages
18h 25m
English
O'Reilly Media, Inc.
Content preview from Head First JavaScript Programming

Chapter 7. Serious types

Types, Equality, Conversion and All That Jazz

image with no caption

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 from the official language of Webville? ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First JavaScript Programming, 2nd Edition

Head First JavaScript Programming, 2nd Edition

Eric Freeman, Elisabeth Robson
Head First HTML and CSS, 2nd Edition

Head First HTML and CSS, 2nd Edition

Elisabeth Robson, Eric Freeman
JavaScript from Beginner to Professional

JavaScript from Beginner to Professional

Rob Percival, Laurence Svekis, Maaike van Putten, Codestars By Rob Percival

Publisher Resources

ISBN: 9781449340124Errata PageSupplemental Content