Created
September 28, 2013 19:00
-
-
Save bitbrain/6745271 to your computer and use it in GitHub Desktop.
Javascript attributes
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 myClass = function() { | |
this.attribut1 = "Heisenberg"; | |
this.attribut2 = "Heisenberg"; | |
getAttribut1 : function() { | |
return this.attribut1; | |
} | |
} | |
var element = new myClass(); | |
alert(element.getAttribut1()); // should output attribut1 | |
// Appending something via prototype | |
element.prototype.newattribute = "This should be a new attribute"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment