Last active
January 1, 2018 12:27
-
-
Save AndriiBozh/121afc6426dfabbb09bbe30b4858d11c to your computer and use it in GitHub Desktop.
Setting Gear (freeCodeCamp challenge)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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