I'm getting started with node.js and I'm having a hard time figuring out what version of Javascript is supported by node which makes it difficult figuring out what features I can use. Here's what I know.
- node uses V8 [http://nodejs.org/]
- V8 implements ECMAScript as specified in ECMA-262, 3rd edition [http://code.google.com/p/v8/]
- ECMA-262, 3rd edition is Javascript 1.5 [http://en.wikipedia.org/wiki/JavaScript#Versions]
Given this, I would assume I can use Javascript 1.5 compatible code in node. However, it turns out I can use the Array.forEach, among other constructs, even though according to MDC it isn't available until Javascript 1.6 -- ECMA-262, 5th edition [https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach].
Where am I going wrong? Is there a document somewhere that details the available language features? Thanks!