- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript navigator Object
JavaScript Storage & BOM
JavaScript navigator Object
navigatordescribes the browser and device running the page.
It is mostly used to check what the browser can do, not what it is.
Checking for a feature directly is more reliable than checking the browser's name.
Example
Example
javascript
console.log(typeof navigator.onLine);
console.log(typeof navigator.language);The output is boolean then string.
Useful Properties
onLine - whether the browser believes it has a connection.
language - the browser's preferred language.
clipboard and geolocation - access to device features.
