C O N T E N T S

1: Jumping straight in

Start here

About this introductory section

A simple HTML page

Exercise 1 - HTML page

Where to start a program

Exercise 2 - Date & time

What if it doesn't work? - The console

Explaining the date/time code

Keeping time

Exercise 3 - Ticking clock

Input

Exercise 4 - Input name

Forms

Programming that form

Exercise 5 - Calculator

Drawing graphics

Exercise 6 - Graphics

Designing an application

Next steps

Some programming principles

Exercise H1 - Game requirements

2: The core language

Start again - properly

Running JavaScript

JavaScript naming rules

Data types, variables, comments

Number

Boolean

Operators

Bits & bytes

String (and characters)

Statements & compound statements

Global and local variables - scope

Conditional statements

Loop statements

break & continue

Exercise 7 - Loops and conditions

Functions

Exercise H2 - Top level

Objects - the key to JavaScript

Methods

Prototypes

Inheritance

var, let & const

Arrays

Object properties as arrays - important!

Loops of the 3rd kind

Exercise 8 - Generate HTML table

The global object - and a WARNING

Useful core objects

Exercise 9 - String and Global methods

Regular Expressions

Exercise 10 - Regular expressions

Throwing and catching exceptions

Exercise 11 - Exceptions

Values vs references

Equality (==) and identity (===)

Garbage collection

Determining variable type

Some more operators

Function arguments (parameters)

Function literals

Graphics

Exercise 12 - Charts

Exercise H3 - Completing the game

3: JavaScript with HTML

Client JavaScript

Move to an IDE - localhost

The user interface

Handling events

Event listeners

Event data

Exercise 13 - Event handling

The entire process: from event to display

Timers - setTimeout, setInterval, requestAnimationFrame

Outline for video games

Images & simple animation

Processing image pixels

Some useful objects

Determining screen size

Cookies

JSON = JavaScript Object Notation

Local storage

Exercise 14 - Improved drawing

Loading & saving images

Putting it on the web

Appendix

References/links

End of course