2 ms·
I'm not sure the actual history bears out your assertion that 1995 was the fix-point date for all/most of these concepts. AIUI, functions were not originally f
by _getify 13y ago
I'm not sure the actual history bears out your assertion that 1995 was the fix-point date for all/most of these concepts.
AIUI, functions were not originally first-class citizens. My understanding is (and I may very well be incorrect), in these very early days, functions not being objects precluded an awful lot of what we currently "know" to be true about how JS emulates "classes" with function.prototype. I tried to find good citations for this fact, but I'm having trouble finding good "early JavaScript" history.
I do know that at least as early as ES1, in mid-1997, we had constructors with prototypes and "new". [1]
In any case, besides `Object.create()` which you've noted, here are some other milestones in the evolution of "OO in JS" I could find:
`instanceof` was added in JavaScript 1.4 [2], which was sometime after Oct 1998 [3], probably officially in ES3.
`Object#isPrototypeOf()` was added in ES3 [4], which was around late 1999.
`Object.getPrototypeOf()` was added in ES5 [5], which was around 2009.
[1] http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%201st%20edition,%20June%201997.pdf http://www.ecma-international.org/publications/files/ECMA-ST...
[2] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/instanceof https://developer.mozilla.org/en-US/docs/JavaScript/Referenc...
[3] http://en.wikipedia.org/wiki/Javascript#Version_history http://en.wikipedia.org/wiki/Javascript#Version_history
[4] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/isPrototypeOf https://developer.mozilla.org/en-US/docs/JavaScript/Referenc...
[5] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/getPrototypeOf https://developer.mozilla.org/en-US/docs/JavaScript/Referenc...