Provides boolean flags indicating which JavaScript runtime environment
the code is currently executing in. Only one flag should be true at a time,
allowing for runtime-specific behavior and feature detection.
Example
construntime = runtimeFn(); if (runtime.isNodeIsh) { console.log('Running in Node.js or Bun'); } elseif (runtime.isBrowser) { console.log('Running in a browser'); }
Runtime environment detection result.
Provides boolean flags indicating which JavaScript runtime environment the code is currently executing in. Only one flag should be true at a time, allowing for runtime-specific behavior and feature detection.
Example