Skip to Main Content
D3 for the Impatient
book

D3 for the Impatient

by Philipp K. Janert
May 2019
Intermediate to advanced content levelIntermediate to advanced
256 pages
6h 5m
English
O'Reilly Media, Inc.
Book available
Content preview from D3 for the Impatient

Appendix C. Hitchhiker’s Guide to JavaScript and the DOM

JavaScript

If you have used a language from the C, C++, C#, and Java family, then the JavaScript syntax will feel immediately familiar. And if you have used any dynamically typed language (like Perl, Python, or Ruby) before, then most of JavaScript’s semantics will appear familiar as well.

That being said, JavaScript holds more than its fair share of surprises. Following is a list of “gotchas”—features of the JavaScript language that you are likely to encounter in practice (when working with D3 in particular) that might not become obvious just by reading the code or skimming the reference. (This section does not pretend to be a comprehensive introduction to the JavaScript language; see the pointers at the end of this appendix for some recommendations.)

Hosted language

JavaScript was originally designed to run in a hosted environment, specifically, in the browser. This means that many services usually provided by the operating system are unavailable; in particular, the filesystem is inaccessible (and so is the standard output channel). The network, on the other hand, can be reached. The purpose of the Node.js project is to provide a standalone JavaScript runtime environment that can run outside of a hosted environment (“on the server,” as opposed to in the browser).

The host environment provides a number of services. Of particular practical importance is the global console object, which gives the programmer access to the ...

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

Hands-On Large Language Models

Hands-On Large Language Models

Jay Alammar, Maarten Grootendorst

Publisher Resources

ISBN: 9781492046783Errata Page