coderef

JavaScript (initial core language support)Baseline · Widely available

JavaScript is a programming language that runs in browsers, usually through the <script> element. JavaScript has changed over many years. This feature represents the oldest language features, such as built-in objects, statements, and operators. Also known as ECMAScript.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.

Browser support

DesktopChrome
1–4Not supported
5+Supportedsince May 25, 2010
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1+Supportedsince Nov 9, 2004
Current: 157
Safari
1–4Not supported
5+Supportedsince Jun 7, 2010
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1–4Not supported
4.2+Supportedsince Nov 22, 2010
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Boolean.

Feature detection

JS · check before using
if (typeof Boolean !== "undefined") {
  // Boolean is available
}

Sub-features

Support for each part of the feature (102). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Boolean112111841
Boolean.Boolean112111841
Boolean.toString112111841
Boolean.valueOf112111841
Error112111841
Error.Error112111841
Error.message112111841
Error.name112111841
Error.toString112111841
EvalError112111841
EvalError.EvalError112111841
RangeError112111841
RangeError.RangeError112111841
ReferenceError112111841
ReferenceError.ReferenceError112111841
SyntaxError112111841
SyntaxError.SyntaxError112111841
TypeError112111841
TypeError.TypeError112111841
URIError112111841
Show 82 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
URIError.URIError112111841
decodeURI11211.11841
decodeURIComponent11211.11841
encodeURI11211.11841
encodeURIComponent11211.11841
eval112111841
isFinite112111841
parseFloat112111841
undefined112111841
boolean_literals112111841
hexadecimal_escape_sequences112111841
null_literal112111841
trailing_commas112111841
trailing_commas.trailing_commas_in_object_literals112131841
unicode_escape_sequences112111841
addition112111841
addition_assignment112111841
assignment112111841
bitwise_and112111841
bitwise_and_assignment112111841
bitwise_not112111841
bitwise_or112111841
bitwise_or_assignment112111841
bitwise_xor112111841
bitwise_xor_assignment112111841
comma112111841
conditional112111841
decrement212141843.2
delete112111841
division112111841
division_assignment112111841
equality112111841
greater_than112111841
greater_than_or_equal112111841
grouping112111841
in112111841
increment212141843.2
inequality112111841
instanceof112111841
left_shift112111841
left_shift_assignment112111841
less_than112111841
less_than_or_equal112111841
logical_and112111841
logical_not112111841
logical_or112111841
multiplication112111841
multiplication_assignment112111841
new112111841
null112111841
property_accessors112111841
remainder112111841
remainder_assignment112111841
right_shift112111841
right_shift_assignment112111841
strict_equality112111841
strict_inequality112111841
subtraction112111841
subtraction_assignment112111841
this112111841
typeof112111841
unary_negation112111841
unary_plus112111841
unsigned_right_shift112111841
unsigned_right_shift_assignment112111841
void11213.11843
block112111841
break112111841
continue112111841
debugger512151844.2
do_while112111841
empty312151844.2
for112111841
for_in112111841
if_else112111841
label112111841
return112111841
switch112111841
throw112111841
try_catch112111841
var112111841
while112111841