4 ms·
The beauty of javascript is that it is supported in multiple environments (various browsers, rhino, v8, etc). But with that comes VM specific implementations, a
by didip 16y ago
The beauty of javascript is that it is supported in multiple environments (various browsers, rhino, v8, etc). But with that comes VM specific implementations, and that's real life.
To truly achieve what the author said, programmer has to dumb-down their javascript to the lowest common denominator. Or have one common library to make sure all javascript features are supported, even if some have to be written in javascript.
Take array comprehension for example (https://developer.mozilla.org/en/New_in_JavaScript_1.7 https://developer.mozilla.org/en/New_in_JavaScript_1.7). Rhino, since it's a Mozilla thing, supports it. How about IE? I'm not sure if V8 even supports that.
Separation between server side and client side is bound to happen. Especially since it's a lot easier to use bleeding edge features on server side.
- jashkenas 16y agoExcept that there are plenty of cross-browser-incompatible features that aren't exactly "bleeding-edge", unfortunately. For example, in IE < 9, there is no implementation of "Array#indexOf" -- the only way to check if a value is present in an array is to write out a loop to check each element.