Skip to Content
Speaking JavaScript
book

Speaking JavaScript

by Axel Rauschmayer
February 2014
Beginner to intermediate content levelBeginner to intermediate
460 pages
8h 32m
English
O'Reilly Media, Inc.
Content preview from Speaking JavaScript

Chapter 3. The Nature of JavaScript

JavaScript’s nature can be summarized as follows:

It’s dynamic
Many things can be changed. For example, you can freely add and remove properties (fields) of objects after they have been created. And you can directly create objects, without creating an object factory (e.g., a class) first.
It’s dynamically typed
Variables and object properties can always hold values of any type.
It’s functional and object-oriented
JavaScript supports two programming language paradigms: functional programming (first-class functions, closures, partial application via bind(), built-in map() and reduce() for arrays, etc.) and object-oriented programming (mutable state, objects, inheritance, etc.).
It fails silently
JavaScript did not have exception handling until ECMAScript 3. That explains why the language so often fails silently and automatically converts the values of arguments and operands: it initially couldn’t throw exceptions.
It’s deployed as source code
JavaScript is always deployed as source code and compiled by JavaScript engines. Source code has the benefits of being a flexible delivery format and of abstracting the differences between the engines. Two techniques are used to keep file sizes small: compression (mainly gzip) and minification (making source code smaller by renaming variables, removing comments, etc.; see Chapter 32 for details).
It’s part of the web platform
JavaScript is such an essential part of the web platform (HTML5 APIs, DOM, ...
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

The Joy of JavaScript

The Joy of JavaScript

Luis Atencio
Secrets of the JavaScript Ninja, Second Edition

Secrets of the JavaScript Ninja, Second Edition

Bear Bibeault, Josip Maras, John Resig

Publisher Resources

ISBN: 9781449365028Errata