Function isBrowser

    • Checks if the code is running in a browser environment

      Returns boolean

      true if running in a browser, false otherwise

      if (isBrowser()) {
      // Use localStorage, fetch, etc.
      window.localStorage.setItem('key', 'value')
      }

      detectEnvironment for full environment detection