JavaScript navigator appVersion property

The navigator.appVersion property in JavaScript represents the version of the browser used to run the current script. It is a read-only property that returns a string value.

Here is an example of how to use the navigator.appVersion property:

// check the version of the current browser
if (navigator.appVersion.indexOf("10.0") != -1) {
  // do something specific for version 10 of the current browser
}

In the above code, we are checking the value of the navigator.appVersion property and using the indexOf() method to check if it contains the string “10.0”. If it does, we can execute some code that is specific to version 10 of the current browser.

Note that the value of the navigator.appVersion property may vary depending on the browser being used and its version. For example, it may return “5.0 (Windows)” for Internet Explorer 5 on Windows, “5.0 (Macintosh)” for Internet Explorer 5 on Mac OS, or “4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)” for Internet Explorer 6 on Windows XP.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: