Global object structure
The global object in Arc contains all standard ECMAScript built-ins plus theArc namespace for BEAM-specific functionality.
Standard globals
Arc implements standard ECMAScript global properties and functions:Value properties
undefinedNaNInfinityglobalThis
Function properties
parseInt()parseFloat()isNaN()isFinite()eval()
Constructor functions
ObjectFunctionArrayStringNumberBooleanSymbolPromiseMap/SetWeakMap/WeakSetRegExp- Error types
Namespaced objects
MathJSONArc(BEAM-specific)
globalThis
TheglobalThis property provides access to the global object in any environment. This is the standard ECMAScript way to access the global scope.
globalThis is the recommended way to access the global object in portable code, as it works consistently across all JavaScript environments.Global functions
parseInt()
Parses a string argument and returns an integer of the specified radix.The value to parse. Leading whitespace is ignored.
An integer between 2 and 36 representing the base. If omitted or 0, base 10 is assumed (or base 16 if the string starts with
0x).number - The parsed integer, or NaN if the first non-whitespace character cannot be converted.
parseFloat()
Parses a string argument and returns a floating-point number.The value to parse. Leading whitespace is ignored.
number - The parsed floating-point number, or NaN if the first non-whitespace character cannot be converted.
isNaN()
Determines whether a value isNaN after coercing it to a number.
The value to test. Non-number values are coerced to numbers before testing.
boolean - true if the value is NaN after coercion, false otherwise.
isFinite()
Determines whether a value is a finite number after coercing it to a number.The value to test. Non-number values are coerced to numbers before testing.
boolean - true if the value is a finite number after coercion, false otherwise.
eval()
Evaluates JavaScript code represented as a string.A string representing JavaScript code to evaluate.
URI handling functions
Arc provides standard URI encoding and decoding functions:encodeURI()
Encodes a URI by escaping special characters, except those that are valid in URIs.decodeURI()
Decodes a URI previously created byencodeURI() or similar.
encodeURIComponent()
Encodes a URI component by escaping all special characters.decodeURIComponent()
Decodes a URI component previously created byencodeURIComponent() or similar.
Legacy functions
escape() / unescape()
Arc includesescape() and unescape() for compatibility with legacy code, but these functions are deprecated and should not be used in new code.
Arc namespace
TheArc global namespace provides BEAM-specific concurrency and process management functions:
Differences from browser environments
No console object
No console object
Arc does not provide the browser
console object. Use Arc.log() instead for logging output.No DOM APIs
No DOM APIs
Arc is a server-side runtime and does not include DOM APIs like
document, window, setTimeout, or fetch.No timers
No timers
Traditional timer functions (
setTimeout, setInterval) are not available. Use Arc.sleep() for delays in spawned processes.No module system (yet)
No module system (yet)
Arc currently executes single-file scripts. ES modules (
import/export) and CommonJS (require) are not yet implemented.