scrimba
Learn Modern JavaScript
Write Concise Declarative Functions with ES6
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Write Concise Declarative Functions with ES6
AboutCommentsNotes
Write Concise Declarative Functions with ES6
Expand for more info
index.js
run
preview
console
const bicycle = {
gear: 2,
setGear: function(newGear) {
"use strict";
this.gear = newGear;
}
};

bicycle.setGear(3);
console.log(bicycle.gear);
Console
3
,
index.html
-0:28