Loading workspace environment...
Learn what an execution environment provides beyond raw language syntax.
// Check the current runtime type
const isBrowser = typeof window !== "undefined";
const hasConsole = typeof console !== "undefined";
console.log("Running in SyntexFlow Sandbox!");
console.log("Console API available:", hasConsole);
console.log("Browser window object present:", isBrowser);Running in SyntexFlow Sandbox!
Console API available: true
Browser window object present: falsetypeof console !== "undefined"Checks if the runtime provides the console object.// Trying to access browser DOM buttons in a pure server/Node.js script:
document.getElementById("my-btn");// Only use document in browser environments; use standard language APIs in general scriptsArchitectural Explanation: Runtimes have different APIs. document exists in browsers, but not in pure Node.js or terminal runtimes.
Write a small script that checks if Math and Date are provided by the runtime and logs a confirmation.