JavaScript (JS) is the lingua franca of web development. It supports functional (especially for web programming), and object-oriented programming paradigms, and has weak typing. A popular superset of JavaScript is TypeScript, which adds static typing analysis.

Reserved keywords in JS:

break case catch class const continue debugger default
delete do else enum export extends false finally for
function if implements import interface in instanceof let
new package private protected public return static super
switch this throw true try typeof var void while with yield

let, const are block scoped var is function or global scoped

Basics

We can embed JavaScript within HTML documents with the <script> tag. Some additional features:

  • <script src="code.js"></script> can compactly embed a JS program stored in a different file.

Idioms

Re: style guide, Standard JS is the standard: *

Language features

Tooling

JavaScript tooling is fairly diverse. For this reason, we’ll have a bigger section.

  • Language extensions and development
    • TypeScript, which adds static typing, strongly recommended over vanilla JS
    • Vite, a popular way to bootstrap a comprehensive JS project
  • Libraries and frameworks
    • Front-end
    • Back-end
      • Node.js, a JS runtime based on Google’s V8 engine, built in C++
      • Deno, a runtime also based on V8, built in Rust
      • Bun, a runtime based on Apple’s WebKit engine, built in Zig

Resources

See also