Function isBrowser
Returns boolean
true
if running in a browser,false
otherwiseExample
if (isBrowser()) {
// Use localStorage, fetch, etc.
window.localStorage.setItem('key', 'value')
}See
detectEnvironment for full environment detection
true
if running in a browser, false
otherwise
if (isBrowser()) {
// Use localStorage, fetch, etc.
window.localStorage.setItem('key', 'value')
}
detectEnvironment for full environment detection
Checks if the code is running in a browser environment