How can you detect the version of a browser using Javascript?

JavascriptFront End TechnologyObject Oriented Programming

To detect the browser version on the client machine, your script can analyze the value of navigator.appVersion or navigator.userAgent.

Example

console.log(navigator.appVersion)

Output

This will give the output based on your browser and its version −

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
raja
Published on 02-Dec-2019 10:54:09
Advertisements