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 yieldlet, 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
- Programming paradigms
- Asynchronous programming (
async,await) - Web programming
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
Resources
- Eloquent JavaScript: A Modern Introduction to Programming, by Marijn Haverbeke
- You Don’t Know JS Yet (and first edition), by Kyle Simpson