admin管理员组

文章数量:1026989

After reading documentation of underscore.js I found (to my surprise) that actually not all browsers support

  • forEach
  • filter
  • every
  • some

methods. Previously I thought that these methods are implemented everywhere. Checking what browsers does not support them, did not give me any information: my chrome, IE9, firefox 13 all supports them.

So where can I find what browsers support them and may be what other methods are not supported everywhere?

P.S I am sorry, I think I confused someone with my question. I know that all browsers support underscore's foreach. In the question I refer to native methods.

After reading documentation of underscore.js I found (to my surprise) that actually not all browsers support

  • forEach
  • filter
  • every
  • some

methods. Previously I thought that these methods are implemented everywhere. Checking what browsers does not support them, did not give me any information: my chrome, IE9, firefox 13 all supports them.

So where can I find what browsers support them and may be what other methods are not supported everywhere?

P.S I am sorry, I think I confused someone with my question. I know that all browsers support underscore's foreach. In the question I refer to native methods.

Share Improve this question edited Oct 13, 2015 at 5:40 user3335966 2,7454 gold badges32 silver badges33 bronze badges asked Nov 9, 2012 at 13:00 Salvador DaliSalvador Dali 223k151 gold badges724 silver badges765 bronze badges 2
  • possible duplicate of What's the current status of Javascript ES5? – Bergi Commented Nov 9, 2012 at 13:08
  • Sure, the question are not the same (because you only asked for a part of ES5), but I wanted to link it for others – Bergi Commented Nov 9, 2012 at 13:28
Add a ment  | 

4 Answers 4

Reset to default 12

here is a nice patibility table: http://kangax.github./es5-pat-table/

I normally take a look at http://kangax.github./es5-pat-table/ which has a pretty good table off support for allot of javascript methods.

They ave been around for some time. JavaScriptKit is a good resource.

All modern browsers with JavaScript 1.6+ support implement these methods.

Javascriptkit: Arrays

All browsers will support underscore's methods forEach, filter, every and some (and any other methods). It is just that some of them will be not as efficient because they don't have native counterparts.

As an example, check forEach: underscore first checks if the Array prototype supports forEach natively with nativeForEach = ArrayProto.forEach. If it does, it uses the native prototype method. If not, it uses it's own implementation with a for loop (in collection functions, see var each = _.each = _.forEach = function(obj, iterator, context) ....

After reading documentation of underscore.js I found (to my surprise) that actually not all browsers support

  • forEach
  • filter
  • every
  • some

methods. Previously I thought that these methods are implemented everywhere. Checking what browsers does not support them, did not give me any information: my chrome, IE9, firefox 13 all supports them.

So where can I find what browsers support them and may be what other methods are not supported everywhere?

P.S I am sorry, I think I confused someone with my question. I know that all browsers support underscore's foreach. In the question I refer to native methods.

After reading documentation of underscore.js I found (to my surprise) that actually not all browsers support

  • forEach
  • filter
  • every
  • some

methods. Previously I thought that these methods are implemented everywhere. Checking what browsers does not support them, did not give me any information: my chrome, IE9, firefox 13 all supports them.

So where can I find what browsers support them and may be what other methods are not supported everywhere?

P.S I am sorry, I think I confused someone with my question. I know that all browsers support underscore's foreach. In the question I refer to native methods.

Share Improve this question edited Oct 13, 2015 at 5:40 user3335966 2,7454 gold badges32 silver badges33 bronze badges asked Nov 9, 2012 at 13:00 Salvador DaliSalvador Dali 223k151 gold badges724 silver badges765 bronze badges 2
  • possible duplicate of What's the current status of Javascript ES5? – Bergi Commented Nov 9, 2012 at 13:08
  • Sure, the question are not the same (because you only asked for a part of ES5), but I wanted to link it for others – Bergi Commented Nov 9, 2012 at 13:28
Add a ment  | 

4 Answers 4

Reset to default 12

here is a nice patibility table: http://kangax.github./es5-pat-table/

I normally take a look at http://kangax.github./es5-pat-table/ which has a pretty good table off support for allot of javascript methods.

They ave been around for some time. JavaScriptKit is a good resource.

All modern browsers with JavaScript 1.6+ support implement these methods.

Javascriptkit: Arrays

All browsers will support underscore's methods forEach, filter, every and some (and any other methods). It is just that some of them will be not as efficient because they don't have native counterparts.

As an example, check forEach: underscore first checks if the Array prototype supports forEach natively with nativeForEach = ArrayProto.forEach. If it does, it uses the native prototype method. If not, it uses it's own implementation with a for loop (in collection functions, see var each = _.each = _.forEach = function(obj, iterator, context) ....

本文标签: