liveBook · Manning

Chapter 1: JavaScript is everywhere

What you will learn in chapter 1 of Secrets of the JavaScript Ninja, Third Edition

The introduction explains how JavaScript evolved from a browser scripting language into a versatile language with better performance and development tools.

After this chapter you will be able to

Section by section

Introduction

The introduction explains how JavaScript evolved from a browser scripting language into a versatile language with better performance and development tools.

Key terms: JavaScript engines, ECMAScript standards process, Node.js runtime, TypeScript, IDE integration, static analysis

1.1 Understanding the JavaScript language

This section explains three ways JavaScript differs from familiar class-based languages: its first-class functions, prototype-based objects, and single-threaded execution.

Key terms: first-class objects, functions, prototypes, class keyword, prototype-based object orientation, single-threaded, asynchronous operations, callbacks, promises

1.1.1 JavaScript runtimes and engines

This section explains how JavaScript runtimes execute code, provide access to their host environments, and sometimes support code written for other runtimes.

Key terms: runtime, engine, just-in-time compilation, API bindings, host environment, DOM, runtimes, jsdom, WebContainers

1.1.2 How does JavaScript get new features?

Explains how ECMAScript standards add JavaScript features and why runtime support matters when using them.

Key terms: ECMAScript, JavaScript, ECMAScript Committee, ECMAScript standard, ES6, ES2015, runtimes, ECMAScript compatibility table

1.1.3 Transpilers and polyfills give us access to tomorrow’s JavaScript today

This section explains how transpilers and polyfills let code use newer JavaScript features in older runtimes, and why runtime compatibility still needs checking.

Key terms: transpiler, transpilation, ECMAScript standards, TypeScript compiler, polyfill, Promise, Babel, TypeScript, Regex lookbehind assertions, runtimes

1.2 Navigating the world of frameworks

Introduces frameworks as core application libraries and explains why choosing one that fits a project matters.

Key terms: framework, library, open-source ecosystem

1.2.1 Web UI frameworks

This section explains how web UI frameworks evolved, how React updates pages, and the trade-offs involved in choosing and rendering frameworks.

Key terms: jQuery, React, JSX, virtual DOM, DOM, open-source ecosystem, component libraries, server-side rendering, SSR

1.2.2 Server frameworks

This section explains why Node.js web servers commonly use frameworks and compares minimal, feature-rich, CMS, and full-stack options.

Key terms: Node.js, HTTP requests, server framework, handler functions, Express, Adonis, CMS framework, Keystone, ORM, full-stack frameworks

1.2.3 App frameworks

This section explains how JavaScript app frameworks support desktop and mobile development through web views or platform-specific UI components.

Key terms: write once, run anywhere, desktop and mobile applications, embedded web view, Electron, Ionic, React Native, JSX, View, component libraries, platform-specific design standards

1.3 Using current best practices

The section introduces best practices as a necessary complement to JavaScript knowledge for producing quality code.

Key terms: best practices, type checking, linting/formatting, testing

1.3.1 Type checking

This section explains why JavaScript’s flexible typing can cause surprising errors and how TypeScript’s type annotations help catch them and inform development tools.

Key terms: flexible type system, type coercion, TypeScript, type annotations, TypeScript compiler, compile time, runtime, type information, VS Code

1.3.2 Linting and formatting

This section explains how linters flag error-prone patterns and enforce style rules, while formatters make code consistently readable.

Key terms: linter, ESLint, no-unreachable, no-shadow, shadowing, linter rules, capitalized-comments, auto-fix, formatter, Prettier

1.3.3 Testing

This section explains why running tests matters, how unit and end-to-end tests differ, and how the book uses console.assert for brief checks.

Key terms: type checking, linting, test framework, assertions, unit tests, end-to-end tests, mocked, fixtures, dependencies, console.assert

1.4 Challenges facing JavaScript Ninjas

1.4.1 Performance

This section explains why slow JavaScript-heavy websites matter and how code bloat can make them slow despite improvements in JavaScript engines.

Key terms: JavaScript engines, sluggish website, code bloat, packages, bandwidth, CPU

1.4.2 Collaboration at scale

This section explains the architectural tradeoff between a single shared codebase and independently updated units when multiple teams build one application.

Key terms: single codebase, single unit, dependencies, separate units, independently, dependency changes, deploy

1.4.3 Dependency management

This section explains how third-party dependencies can introduce compatibility and security problems, and why developers should weigh those risks before adding a package.

Key terms: dependencies, semantic versioning, indirect dependency, ES module, CommonJS, supply chain attack, third-party code, dependency

1.5 Summary

Where this is used later

Concepts explained in this chapter

Chapter 2: Using modern JavaScript tools →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.