Skip to content

Instantly share code, notes, and snippets.

@hejrobin
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hejrobin/e8d4e1fce2d6f911f6ea to your computer and use it in GitHub Desktop.
Save hejrobin/e8d4e1fce2d6f911f6ea to your computer and use it in GitHub Desktop.
class Vessel
constructor: (@type, @name) ->
# Create a new ship!
ship = new Vessel('Schooner', 'Wasa')
console.debug ship.type #>> Schooner
var Vessel, ship;
Vessel = (function() {
function Vessel(type, name) {
this.type = type;
this.name = name;
}
return Vessel;
})();
ship = new Vessel('Schooner', 'Wasa');
console.debug(ship.type);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment