Skip to content

Instantly share code, notes, and snippets.

@Macagare
Created November 12, 2012 08:32
Show Gist options
  • Save Macagare/4058166 to your computer and use it in GitHub Desktop.
Save Macagare/4058166 to your computer and use it in GitHub Desktop.
JavaScript: class (using object literals)
var apple = {
type: "macintosh",
color: "red",
getInfo: function () {
return this.color + ' ' + this.type + ' apple';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment