HomepageExploring JavaScript (ES2024 Edition)
You can support this book: buy it or donate
(Ad, please don’t block.)

4 The nature of JavaScript

4.1 JavaScript’s influences

When JavaScript was created in 1995, it was influenced by several programming languages:

With ECMAScript 6, new influences came to JavaScript:

4.2 The nature of JavaScript

These are a few traits of the language:

4.2.1 JavaScript often fails silently

JavaScript often fails silently. Let’s look at two examples.

First example: If the operands of an operator don’t have the appropriate types, they are converted as necessary.

> '3' * '5'
15

Second example: If an arithmetic computation fails, you get an error value, not an exception.

> 1 / 0
Infinity

The reason for the silent failures is historical: JavaScript did not have exceptions until ECMAScript 3. Since then, its designers have tried to avoid silent failures.

4.3 Tips for getting started with JavaScript

These are a few tips to help you get started with JavaScript: