Checks if the current environment is a browser.
Tests for the presence of window and window.document objects.
true if running in a browser environment
if (isBrowser()) { // Safe to use DOM APIs document.querySelector('#app');} Copy
if (isBrowser()) { // Safe to use DOM APIs document.querySelector('#app');}
Checks if the current environment is a browser.
Tests for the presence of window and window.document objects.