You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The destructuring parameter lists syntax isn't mentioned in the docs anywhere, and the syntax is really neat:
class Man
constructor: ({@name, @description}) ->
# empty constructor. is magic.
# note the curly braces
# note the use of a named parameter list on initialisation
dave = new Man
name: 'Dave'
description: 'a dude'
console.log "#{dave.name} is #{dave.description}" # output: Dave is a dude