Objects cheatsheet
Basic usage
const app = {
name: "todo",
version: 1.2,
};
alert(app.name); // todo
alert(app.version); // 1.2
app.version = 1.3; // update value
app.license = "MIT"; // add new property
delete app.version; // delete propertyconst game = {
name: "sudoku",
"is free": true,
};
alert(game["is free"]); // true
const isFree = "is free";
alert(game[isFree]); // trueReferences and copying
Iterating objects
Object methods & this
Constructors
Property existance
Flags & descriptors
Getters & setters
Last updated