Last active
December 12, 2015 09:19
-
-
Save johnstew/4750274 to your computer and use it in GitHub Desktop.
Basic JavaScript Class with gets/sets
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
window.onload = function(){ | |
function Car(type, year, value){ | |
this.type = type; | |
this.year = year; | |
this.value = value; | |
this.setType = function(t){ | |
this.type = t; | |
} | |
this.getType = function(){ | |
return this.type; | |
} | |
this.setYear = function(y){ | |
this.year = y; | |
} | |
this.getYear = function(){ | |
return this.year; | |
} | |
this.setValue = function(v){ | |
this.value = v; | |
} | |
this.getValue = function(){ | |
return this.value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment