Which web browsers natively support Array.forEach() - javascript

Which browsers other than Firefox support Array.forEach()? Mozilla say it's an extension to the standard and I realise it's trivial to add to the array prototype, I'm just wondering what other browsers support it?

I just checked this for another question: JavaScript for...in vs for.
On kangax's ECMAScript 5 compatibility table, Array.forEach gets a 'yes' for all browsers except IE8.
As of September 2011, IE browser share on desktop devices is less than 40%, and at least 8% of browsers are IE 9.
In other words, Array.forEach is now supported by around 70% of desktop browsers. Obviously, this figure varies considerably, depending on territory and other factors -- some regions or countries (such as Brasil) have a higher proportion of Chrome users, for example, and some (such as China) have far more users on IE6 and IE8.
I haven't checked, but mobile support (on WebKit and Opera browsers) may be even higher.

The JavaScript article of Wikipedia lists the JS versions by browser. forEach is part of JavaScript 1.6. So it is supported indeed by most browsers, except Opera 9.02 (which I just tested). Opera 9.5 (which I just installed!) supports it, along with indexOf for Array.
Surprisingly, it is not official. I don't see its support in the page ECMAScript support in Opera 9.5. Perhaps it is an overlook or perhaps only a partial support they don't want to advertise.

Since IE doesn't support it (not even v8), I use jQuery.each() -- http://docs.jquery.com/Utilities/jQuery.each

All modern browsers but IE.

The Microsoft AJAX client library adds this to the Array prototype so if you have that client library in your site then you'll have it for sure.

If you need all browsers to support this and other JavaScript 1.6 to 1.8 functions, I would suggest using the customizable jPaq library. The functions are implemented in the way that was suggested by Mozilla.

I have checked on caniuse.com and it looks like all browsers support foreach except Opera Mini which has support info as ?Support unknow. If you're interested you can use this link to check the browser support for any features. https://caniuse.com/?search=foreach

Related

Outlook/IE failing to run addins using BigInt data type

Outlook currently uses IE11 as its backend when executing Javascript. Since IE does not fully support ES6/ES2015, IE fails to execute code using "BigInt".
I know for a fact that Microsoft is planning to end support for IE next year. So the chances for IE to be updated to support ES6 is probably almost zero-percent.
In this light, I would like to ask advice on any of the following points :
Is there a way to force outlook to use microsoft Edge as its backend?
Is there a way to get IE to support BigInt (or ES6 fully for that matter)?
Is there any possibility at all that IE supports ES6 before its end of life?
Thank you very much.
Would be a no. From memory, Outlook uses it's own HTML renderer.
Probably, have you tried bigint-polyfill?
Only with a polyfill
Is there a way to force outlook to use microsoft Edge as its backend?
The browser used by Outlook depends on your OS and Office 365 versions. You could refer to the table in this doc. If you want to use Microsoft Edge browser in Outlook, I think you need to update your OS version or Office 365 version according to below:
For question 2, I think it's impossible and I gave my opinion in your question before.
Is there any possibility at all that IE supports ES6 before its end of life?
No. From the statement of Microsoft: Security updates, compatibility fixes, and technical support continues for IE 11 on Windows 7, 8.1, and 10. It means Microsoft has no plan to continue adding features to Internet Explorer 11. So IE 11 won't support ES6 in the future and we can only use polyfill or babel to transpile some ES6 code for IE 11.
Thank you all for your help and answers. Today, I was able to make BigInt work with IE11 and old versions of Safari.
Although, I have not tested the entire BigInt library with IE, I have tested my solution on how to make BigInt work on IE just enough for my needs. I will continue to test though. And if anybody reading this finds a better fix, i hope you can share too.
Here is what I did to make BigInt work for my Outlook-Addin in IE11 :
Installed/added the JSBI Library into my project.
Added some dataview polyfills, from JSBI-dataviews. Please see my comments.
Also based some modifications on elk-chat
I hope this helps everyone.

Using Angular 2 with older browsers thanks to TypeScript?

Since the Angular 2 team is using TypeScript for it's build, would it be a feasible assumption that they could compile a version of Angular 2 that would work on older browsers?
Edit 2:
It appears the Angular team has decided to support some non evergreen browsers. Per Brad Green (of the Angular team): What browsers versions will Angular 2 support? There's a new build widget with some hints on https://github.com/angular/angular
Currently, the Readme shows IE9 and up.
Angular 2 will only support modern browsers:
Modern browsers means the set of browsers known as ‘evergreen’ or
always automatically updated to the latest version. Building for
these browsers let us drop many hacks and workarounds that make
AngularJS harder to use and develop on than it needs to be.
The set currently includes Chrome, FireFox, Opera, Safari, and
IE10/11. On mobile, we’ll support something close to the list of
Chrome on Android, iOS 6+, Windows Phone 8+ and Firefox mobile. We’re
looking into supporting older versions of Android, but the jury is
still out.
http://angularjs.blogspot.com/2014/03/angular-20.html
Edit: To address your comment, no Typescript is not the limiting factor for Angular 2's lack of support for non-modern browsers (nor going to provide any magical support). Typescript can transpile to ES3, so if your target browser supports ES3, you can use Typescript. Conversely, Angular 2 will gain nothing wrt supporting legacy browsers by using TypeScript.

compatibility mode in IE11

How can I use the compatibility mode in IE11 like I had it in IE10?
Under Emulation I find compatibility for documentmodus. But is this realy the old compatibility mode from IE10? Most important for me is the Feature-Set for javascript.
Under Emulation I find compatibility for documentmodus.
Yep, that's right. That's what you're looking for.
But is this realy the old compatibility mode from IE10?
Yes. This is exactly the same feature as the compatibility mode that was available in earlier IE versions.
Most important for me is the Feature-Set for javascript.
I'm not really sure what you mean by this, but the document modes available in IE11 are exactly the same as the ones available in IE10, so whatever you were doing in IE10 should be the same in IE11.
It's worth pointing out that the use of compatibility mode is discouraged in most cases (MS originally planned to drop it from IE11, and only brought it back at the last minute).
If you're using compat mode for testing that your site works with older IE versions, it is not a good solution for this, because the various compatibility modes are not 100% compatible with real IE versions. (this has always been the case; nothing new here with IE11).
For testing purposes, it is better to use real copies of each IE version that you need to support.

List of areas missing support for ECMAScript/JavaScript in major browsers?

Is anyone aware of a definitive list of areas of missing support for ECMAScript/JavaScript in the major browsers (I'm talking IE7+, Firefox, Chrome, Safari and Opera).
Obviously we do feature detection in our code, but I'd like a list of features that we need to perform detection on ideally.
Some commonly referenced sources are
Great compatibility tables at QuirksMode. Some of them are being updated recently.
Kangax sums up ES5 support very well.
Microsoft released reports of IE standards support.
Can I Use also includes some information about support of a few Javascript APIs.
A popular source many folks use is: http://kangax.github.com/es5-compat-table/
For Mozilla: https://developer.mozilla.org/En/JavaScript/ECMAScript_5_support_in_Mozilla
For Webkit: http://labs.trolltech.com/blogs/2010/01/15/ecmascript-5-and-webkitjavascriptcore/
For IE: http://www.microsoft.com/download/en/details.aspx?id=14170
You might find Thomas Lahn's ECMAScript support matrix useful.
I doubt very much that there is a definitive list of all the bugs, non-conformities or inconsistencies of browsers, even if restricted to some (undefined) set of "major browsers". The usual strategy is to program for standards and use feature detection and documented alternatives to work around known inconsistencies. Then test as widely as reasonable to discover the unknowns.
While browsers frequently introduce new features, they rarely remove old ones without a very long period of deprecation. So well written code should continue to work in new browsers even if if contains feature tests to work around inconsistencies in browsers that are no longer in use.

javascript slow in IE but fast in Firefox

It is very slow to access this page using IE, but much faster using Firefox. Especially when I increase the number of nodes of people. Any ideas what is wrong?
http://thejit.org/static/v20/Jit/Examples/RGraph/example1.html
BTW: IE is even slow when accessing from local file system.
thanks in advance,
George
Internet Explorer's Javascript engine is slower than that from other web browsers, at least when using IE with versions lower than 9. So, if you're using IE 6, 7 or 8, now you know why.
Like raynjamin said, try testing IE using Sunspider.
The latest stable Firefox (3.6) is fast, but for example, Google Chrome is even faster. A browser's Javascript speed depends on its underlying implementation.
Update: to give you an idea of how "fast" IE is compared to other browsers, I've done a benchmark on my own computer using Sunspider 0.9.1. Here are the results:
- Internet Explorer 8: 5039.8ms
- Firefox 3.6: 967.9ms (loaded with extensions)
- Chrome 9: 276.3ms
- Opera 10.6: 293.2ms
- Safari 5: 397.0ms
As you can see, IE 8 is about 5 times slower than Firefox 3.6 and almost 20 times slower than Chrome 9, at least when using Sunspider tests. That is a drastic difference and you can see that IE 8 isn't all that fast.
Update 2: There is one way to make IE faster. A plugin called Chrome frame exists. Using this plugin will make IE faster since it will use Chrome's engine. I haven't tried it personally, but I've heard good things about it.
IE is slow. Fact.
Javascript runs much slower in IE than in other modern browsers. You can test it for yourself using a javascript benchmark like sunspider.
Guys Got the Culprit here... :) :)
After doing lot of RnD on Server side and Client side, I took a look at "Developer Tool" in IE. You can find something like "Document Mode: Quirks". If you check the Wiki page for this Quirks mode, You can find a definition as "In computing, quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers, instead of strictly complying with W3C and IETF standards in standards mode."
So this all becuase of checking for compatibility for all components on page. And hence the performance issue. :)
And When I changed this mode to IE 8 Standard. Things started working really well.
IE and its issues ...!!!! :D

Categories

Resources