👃📓

Es6 basic - not even overview

22 Nov 2017

ES6 - an underview

let VS var

Const

Anonymous Functions with Arrow syntax

button.mousePressed(changeBackground);

function changeBackground() {
	background(random(255));
}

//simplifies

button.mousePressed(function button()) {
	background(random(255));
}

//simplifies

button.mousePressed( () => {
	background(random(255));
}

//brackets are optional so can be simplified

button.mousePressed(() => background(random(255)));

Prototypes