Operator:x -= yMeaning:x = x - y Examples Using subtraction assignment // Assuming the following variable // bar = 5 bar -= 2 // 3 bar -= 'foo' // NaN Specifications Specification ECMAScript (ECMA-262) The definition of 'Assignment operators' in that specification. ...
Spread operator No support 49.0 34.0 (34) ? ? ? 49.0 [1] Requires "Enable experimental Javascript features" to be enabled under `about:flags` Firefox-specific notes Firefox provided a non-standard language extension in JS1.7 for destructuring. This extension has been removed in Gecko 40 (Firef...
JavaScript operator: Exponentiation assignment (`x **= y`) Global usage 96.05% + 0% = 96.05% IE ❌ 6 - 10: Not supported ❌ 11: Not supported Edge ❌ 12 - 13: Not supported ✅ 14 - 131: Supported ✅ 132: Supported Firefox ❌ 2 - 51: Not supported ✅ 52 - 134: ...
﹖2.5: Support unknown ﹖3: Support unknownCan I use... Browser support tables for modern web technologies Created & maintained by @Fyrd, design by @Lensco. Support data contributions by the GitHub community. Usage share statistics by StatCounter GlobalStats for January, 2025 Location detection...
You can also use the ternary operator. This provides a compact if else representation.a === 1 ? console.log(1) : console.log('not 1');You can use boolean operations in the expression to create complex predicates. Common boolean operators include && (and), || (or), and ! (not).if...
To make "bar" a declared variable, you can add thevarkeyword in front of it. function foo() { "use strict"; var bar = true; } foo(); See also Strict mode 文档标签和贡献者 标签: Errors JavaScript ReferenceError Strict Mode 此页面的贡献者:fscholz ...
To make "bar" a declared variable, you can add thevarkeyword in front of it. function foo() { "use strict"; var bar = true; } foo(); See also Strict mode Document Tags and Contributors Tags: Errors JavaScript ReferenceError Strict Mode ...