Supported globals

User code runs in a sandbox. Your code can use the globals on this page.

Math

Math is a built-in object that has properties and methods for mathematical constants and functions. It’s not a function object.

Math works with the Number type. It doesn't work with BigInt.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math

Date

JavaScript Date objects represent a single moment in time in a platform-independent format. Date objects contain a Number that represents milliseconds since 1 January 1970 UTC.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

Number

Number is a primitive wrapper object used to represent and manipulate numbers like 37 or -9.25.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number

BigInt

BigInt is a built-in object that provides a way to represent whole numbers larger than 2^53 - 1. This is the largest number that JavaScript can reliably represent with the Number primitive, and the value of the Number.MAX_SAFE_INTEGER constant. BigInt can be used for arbitrarily large integers.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

Boolean

The Boolean object is an object wrapper for a boolean value.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean

String

The String object is used to represent and manipulate a sequence of characters.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String

Object

Error

EvalError

RangeError

ReferenceError

SyntaxError

TypeError

URIError

parseFloat

parseInt

encodeURI

decodeURI

decodeURIComponent

encodeURIComponent

escape

unescape

PropertyKey

isNaN

NaN

isFinite

Infinity

RegExp

Array

ArrayBuffer

DataView

Set

WeakSet

JSON

Promise

Map

WeakMap

setInterval

clearInterval

setTimeout

clearTimeout