public
Created

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13
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 Yep, the "Set Literal Prototype Operator". It's currently a binary operator, but I think its semantics could be easily extended.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.