Comment

Comment by spiralhead

"but I think it was removed in as3"

Wrong. I was curious so i tested it (i've been experimenting with Flex 2). The following code outputs "blah blah":

var foo:Function = function() {}

foo.prototype.someMethod = function() { trace("blah blah"); }

new foo().someMethod();

I think the prototype syntax was kept to maintain backwards compatibility.

parent spiralhead 19 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton