Skip to Content
JavaScript
book

JavaScript

by T. J. Crowder
July 2020
Intermediate to advanced content levelIntermediate to advanced
608 pages
15h 43m
English
Wrox
Content preview from JavaScript

17Miscellany

In this chapter, you'll learn about the various things that didn't really fit anywhere else in the book: BigInt, new forms of numeric literals; various new Math methods; the new exponentiation operator (and a “gotcha” about its precedence); tail call optimization (including why you can't rely on it, yet or possibly ever); some other minor changes; and finally, some browser-only features added to Annex B to document what's universally there anyway.

BIGINT

BigInt1 is a new primitive type for working with large integers in JavaScript, added in ES2020.

BigInt can hold any size of integer, limited only by available memory and/or a reasonable limit imposed by the JavaScript engine's implementers. (Implementer limits are likely to be very, very high. V8 currently allows up to one billion bits.) Do you want to hold the number 1,234,567,890,123,456,789,012,345,678 (an integer with 28 significant digits) in a variable? JavaScript's normal number type (Number) can't begin to think about that, not precisely anyway; ...

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

Advanced JavaScript

Advanced JavaScript

Zachary Shute

Publisher Resources

ISBN: 9781119367956Purchase book