Global Functions
Core JavaScript defines a handful of global functions:
-
escape(s) Encode a string for transmission. JavaScript 1.0; ECMA-262; Unicode support in Internet Explorer 4.
-
eval(code) Execute JavaScript code from a string.
-
getClass(javaobj) Return the JavaClass of a JavaObject. Navigator 3.
-
isFinite(n) Determine whether a number is finite. JavaScript 1.2; ECMA-262.
-
isNaN(x) Check for not-a-number. JavaScript 1.1; ECMA-262.
-
parseFloat(s) Convert a string to a number. JavaScript 1.0; enhanced in JavaScript 1.1; ECMA-262.
-
parseInt(s, radix) Convert a string to an integer. JavaScript 1.0; enhanced in JavaScript 1.1; ECMA-262.
-
unescape(s) Decode an escaped string. JavaScript 1.0; ECMA-262; Unicode support in Internet Explorer 4.
In addition to these core global functions, the Window object defines a number of client-side global methods.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access