JavaScript Navigator Object
The navigator
object is a part of JavaScript that provides information about the client's browser environment. It contains various properties and methods that allow developers to get information like the user's browser type, version, language, platform, etc.
Syntax
navigator.property
Example
// Get the user's browser name
var browserName = navigator.appName;
console.log(browserName);
// Get the user's browser version
var browserVersion = navigator.appVersion;
console.log(browserVersion);
// Get the user's platform
var platform = navigator.platform;
console.log(platform);
// Get the user's language
var language = navigator.language;
console.log(language);
Output
Chrome
5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3
Win32
en-US