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 25. New in ECMAScript 5

This chapter lists features that are available only in ECMAScript 5. Should you have to work with older JavaScript engines, you should avoid these features or enable some of them via a library (how is described later). Note that normally, this book assumes that you are working with modern engines, which fully support ECMAScript 5.

The ECMAScript 5 specification contains the following description of its scope:

The fifth edition of ECMAScript (published as ECMA-262 5th edition)

  • codifies de facto interpretations of the language specification that have become common among browser implementations and
  • adds support for new features that have emerged since the publication of the third edition. Such features include

    • accessor properties,
    • reflective creation and inspection of objects,
    • program control of property attributes,
    • additional array manipulation functions,
    • support for the JSON object encoding format, and
    • a strict mode that provides enhanced error checking and program security.

New Features

The new features included in ECMAScript 5 are as follows:

Strict mode (see Strict Mode)

Putting the following line first in a file or a function switches on the so-called strict mode that makes JavaScript a cleaner language by forbidding some features, performing more checks, and throwing more exceptions:

'use strict';
Accessors (see Accessors (Getters and Setters))

Getters and setters allow you to implement the getting and setting of a property via methods. ...

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