Created
June 15, 2017 06:56
-
-
Save waltzaround/2ffc8206794f5e94628a5678ae2f6493 to your computer and use it in GitHub Desktop.
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
var Car = function() { | |
// this is a private variable | |
var speed = 10; | |
// these are public methods | |
this.accelerate = function(change) { | |
speed += change; | |
}; | |
this.decelerate = function() { | |
speed -= 5; | |
}; | |
this.getSpeed = function() { | |
return speed; | |
}; | |
}; | |
var Bike = function(gear) { | |
this.gear = gear; | |
this.getGear = function() { | |
return gear; | |
}; | |
this.setGear = function(potato) { | |
gear = potato; | |
}; | |
bike.setGear(12312); | |
}; | |
var myCar = new Car(); | |
var myBike = new Bike("dfdf").getGear();\ | |
var str = "dfdfd"; | |
str.split('').length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment