Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I've found the relevant information about this,but I can't checl a specific answer about how to detect the ECMAscript version. Thank's tto advanced. May be you can try to use some data structures that kn specifically added in ES6 like MapSet etc.
So the best way cersion to detect, possibly with 3rd party libs, if the feature wanted exists and then how to do a flick with eyeliner. Otherwise fall back to a more traditional one. Normally it's to try some operations and then check if as expected, no magic. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. How to detect ECMAscript version? Ask Question. Asked 3 years, 5 months ago. Active 3 years, 5 months ago. Viewed 18k times. Improve this question. Add a comment. Active Oldest Votes. Improve this answer. Nandu Kalidindi Nandu Kalidindi 5, 1 1 gold badge 16 16 silver badges 31 31 bronze badges. Thanks for your advice:.
Sign up or log in Sign up using Google. Sign brwoser using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. How often do people actually copy and paste from Stack Overflow? Javascrippt we know. Podcast One in four visitors to Stack Overflow copies code. Featured on Meta. Stack Overflow for Teams is now free for up to 50 users, jqvascript.
Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search.
I did just the popular ones. Updated jsFiddle link. This will return an array, first element is the browser name, second element is the complete version number in string format.
So I had to detect the browser serverside. This page seems to have a pretty nice snippet which only uses the appString and appVersion property as a last resort as it claims them to be unreliable with certain browsers. The code on the page is as follows:. Adding my own implementation of Hermann's answer. I needed OS detection so that's been added. Also includes some ES6 code because we have a transpiler that you might need to ES5-ify.
I want to share this code I wrote for the issue I had to resolve. It was tested in most of the major browsers and works like a charm, for me! It may seems that this code is very similar to the other answers but it modifyed so that I can use it insted of the browser object in jquery which missed for me recently, of course it is a combination from the above codes, with little improvements from my part I made:. For any PWA application using angular you can put the code to check if browser is supported or not in body section of index.
Here this has better compatibility then kennebec snippet; will return browser name and version returns 72 instead of This code snippet is based on the article from MDN. Where they gave a brief hint about various keywords that can be used to detect the browser name. I have done few changes to detect browsers like Edge and UCBrowser. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How can you detect the version of a browser?
Ask Question. Asked 9 years, 11 months ago. Active 3 months ago. Viewed k times. How can I detect the version of a browser like this? Improve this question. Add a comment. Active Oldest Votes. Improve this answer. With the code as it currently stands, the Opera IMO, the correct result would be Opera It would be helpful if this answer included output examples. I can't tell what strings to expect from the function. This script incorrectly reports browser Chrome version 4.
Show 6 more comments. This is an improvement on Kennebec's answer. Here are several prominent libraries that handle browser detection as of May KyleMit KyleMit This combines kennebec's K answer with Hermann Ingjaldsson's H answer: Maintains original answer's minimal code. K Separates browser version and name into independent child objects. H navigator. YakovL 5, 10 10 gold badges 44 44 silver badges 68 68 bronze badges.
Brandon Brandon 3, 2 2 gold badges 9 9 silver badges 24 24 bronze badges. Michael Cole Michael Cole Oliver Moran Oliver Moran 4, 3 3 gold badges 28 28 silver badges 43 43 bronze badges. Outdated reference, no longer supported -"This page used to contain my own browser detect script, but I found that I do not have enough time to keep it up to date.
Therefore I removed it. Danail Gabenski Danail Gabenski 1, 14 14 silver badges 25 25 bronze badges. Thanks Rulisp for your comment and provided sample uagent, since I don't have Edge or Win Just going from it I have updated the code in the jsFiddle to reflect that.
If you want to test with the sample uagent you gave me just go to this fiddle. Let me know if there is something wrong. Michael Bleidistel Michael Bleidistel 1 1 silver badge 2 2 bronze badges. Marek Marek 1, 1 1 gold badge 27 27 silver badges 43 43 bronze badges. Joshua - yes, you are right; at least they left jQuery.
Jez Jez YunHan YunHan 41 5 5 bronze badges. Chazmus Chazmus 31 5 5 bronze badges. Christiyan Christiyan 3 3 silver badges 3 3 bronze badges.
GoharSahi GoharSahi 3 3 silver badges 16 16 bronze badges. Fabian Montoya Fabian Montoya 3 3 silver badges 17 17 bronze badges. Tushar Walzade 3, 4 4 gold badges 26 26 silver badges 45 45 bronze badges. Binyamin Binyamin 6, 10 10 gold badges 57 57 silver badges 78 78 bronze badges. Ankit Ankit 3 3 silver badges 9 9 bronze badges. For this you need to check the value of navigator.
Suryanshu Sahay Suryanshu Sahay 11 1 1 bronze badge. McKayla McKayla 6, 4 4 gold badges 29 29 silver badges 45 45 bronze badges. I wrote this for my needs. Marco Allori Marco Allori 2, 29 29 silver badges 24 24 bronze badges.
Now we know. Podcast One in four visitors to Stack Overflow copies code. Featured on Meta. Stack Overflow for Teams is now free for up to 50 users, forever.