Create a gist now

Instantly share code, notes, and snippets.

Embed
var Person = {
'initialize': function(first, last) {
this.first = first;
this.last = last;
},
'speak': function(message) {
return this.first + ' ' + this.last + ': ' + message;
}
};
// Unary `<|`; equivalent to `{} <| Person`.
var kit = <| Person;
kit.initialize('Kit', 'Goncharov');
@md2perpe

This comment has been minimized.

Show comment
Hide comment
@md2perpe

md2perpe Jun 29, 2011

New operator <|?

New operator <|?

@kitcambridge

This comment has been minimized.

Show comment
Hide comment
@kitcambridge

kitcambridge Jun 30, 2011

@md2perpe Yep, the "Set Literal Prototype Operator". It's currently a binary operator, but I think its semantics could be easily extended.

Owner

kitcambridge commented Jun 30, 2011

@md2perpe Yep, the "Set Literal Prototype Operator". It's currently a binary operator, but I think its semantics could be easily extended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment