Yes, right. However, the article is devoted to exactly ES5 (by Opera's requirement) and is less relevant with ES3. Properties-indices for strings are standardized in ES5, you may easily use them in modern JS programming.

If you have to work with some older browsers, well, the choice is yours. And for the new ES5 era, I recommend to use all new features in full power if needed without thinking about very old stuff especially if you don't need to support it.

Dmitry.

On 26.02.2011 14:39, And Clover wrote:
On Wed, 2011-02-23 at 18:45 +0300, Dmitry A. Soshnikov wrote:
http://dev.opera.com/articles/view/javascript-array-extras-in-detail/
I would take issue with the “Generic nature” section here. The examples
chosen to illustrate it are exactly the two cases where you *shouldn't*
use Array methods generically:

     Array.prototype.map.call("hello world", function (char) { ... });

relies on the feature of Array-like character access for String, which
is a requirement for ES5 but not in ES3. Hence it fails on IE7 and other
older browsers even if you define your own implementation of
Array.prototype.map.

We can also call a method of an array for the DOM nodes collection
Nope: Array.prototype.* are only defined to work generically for native
JS objects, not host objects. This too will fail in IE7 and other
non-modern browsers.


--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to