Skip to content

Instantly share code, notes, and snippets.

@AndriiBozh
Last active January 1, 2018 12:27
Show Gist options
  • Save AndriiBozh/121afc6426dfabbb09bbe30b4858d11c to your computer and use it in GitHub Desktop.
Save AndriiBozh/121afc6426dfabbb09bbe30b4858d11c to your computer and use it in GitHub Desktop.
Setting Gear (freeCodeCamp challenge)
/*
Bike constructor with a private property called "gear"
and two public methods called "getGear" and "setGear"
to get and set that value.
*/
var Bike = function() {
var gear;
this.setGear = function(change) {
gear = change;
};
this.getGear = function() {
return gear;
};
};
var myCar = new Car();
var myBike = new Bike();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment