bhylu.com

Advertisements

JS 1999 (ES3)

The 1999 edition is part of JavaScript history. Older code often uses var and constructor functions rather than modern class syntax.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

function Member(name) { this.name = name; }
var member = new Member("Mira");
console.log(member.name);

What happens

The constructor stores Mira on an instance.