[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Operators [Back]  [Original]

- JavaScript | MDN

MDN Web Docs

View in English Always switch to English

JavaScript

In this article

JavaScript

this

this

function

function

class

class

function*

function* Generator

yield

(Generator)

yield*

(Generator) (Iterable)

async function*

async

await

/

[]

/

{}

/

/ab+c/i

( )

Property accessors

(object.property and object["property"])

new

new (Constructor)

new.target

new.target new (Constructor)

super

super (Constructor)

...obj

The spread operator allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected.

//

A++

A--

++A

--A

delete

delete

void

void

typeof

typeof

+

(Number)

-

(Number)

~

NOT

!

NOT

()

+

-

/

*

%

**

Boolean

in

in

instanceof

instanceof

<

>

<=

>=

=> is not an operator, but the notation for Arrow functions.

Boolean

==

!=

===

!==

<<

>>

>>>

32 (32 ) JavaScript

&

AND

|

OR

^

XOR

() (Boolean)

&&

AND

||

OR

()

(condition ? ifTrue : ifFalse)

=

*=

/=

%=

+=

-=

<<=

>>=

>>>=

&=

AND

^=

XOR

|=

OR

{a, b} = {a:1, b:2} [a, b] = [1, 2]

,

Legacy generator function

The function keyword can be used to define a legacy generator function inside an expression. To make the function a legacy generator, the function body should contains at least one yield expression.

Expression closures

The expression closure syntax is a shorthand for writing simple function.

[for (x of y) x]

Array comprehensions.

(for (x of y) y)

Generator comprehensions.

Specification
ECMAScript 2027 LanguageSpecification
# sec-signed-right-shift-operator
ECMAScript 2027 LanguageSpecification
# sec-unary-minus-operator
ECMAScript 2027 LanguageSpecification
# prod-LogicalANDExpression
ECMAScript 2027 LanguageSpecification
# sec-bitwise-not-operator
ECMAScript 2027 LanguageSpecification
# sec-super-keyword
ECMAScript 2027 LanguageSpecification
# sec-comma-operator
ECMAScript 2027 LanguageSpecification
# sec-postfix-decrement-operator
ECMAScript 2027 LanguageSpecification
# sec-destructuring-assignment
ECMAScript 2027 LanguageSpecification
# sec-postfix-increment-operator
ECMAScript 2027 LanguageSpecification
# sec-assignment-operators
ECMAScript 2027 LanguageSpecification
# prod-FormalParameters
ECMAScript 2027 LanguageSpecification
# sec-left-shift-operator
ECMAScript 2027 LanguageSpecification
# sec-void-operator
ECMAScript 2027 LanguageSpecification
# sec-conditional-operator
ECMAScript 2027 LanguageSpecification
# sec-null-value
ECMAScript 2027 LanguageSpecification
# sec-logical-not-operator
ECMAScript 2027 LanguageSpecification
# sec-import-calls
ECMAScript 2027 LanguageSpecification
# prod-MethodDefinition
ECMAScript 2027 LanguageSpecification
# sec-relational-operators
ECMAScript 2027 LanguageSpecification
# prod-SpreadElement
ECMAScript 2027 LanguageSpecification
# sec-equality-operators
ECMAScript 2027 LanguageSpecification
# prod-BitwiseANDExpression
ECMAScript 2027 LanguageSpecification
# sec-this-keyword
ECMAScript 2027 LanguageSpecification
# sec-async-function-definitions
ECMAScript 2027 LanguageSpecification
# sec-multiplicative-operators
ECMAScript 2027 LanguageSpecification
# prod-ComputedPropertyName
ECMAScript 2027 LanguageSpecification
# sec-delete-operator
ECMAScript 2027 LanguageSpecification
# prod-ImportMeta
ECMAScript 2027 LanguageSpecification
# prod-PropertyDefinition
ECMAScript 2027 LanguageSpecification
# sec-generator-function-definitions-runtime-semantics-evaluation
ECMAScript 2027 LanguageSpecification
# sec-unsigned-right-shift-operator
ECMAScript 2027 LanguageSpecification
# prod-BitwiseORExpression
ECMAScript 2027 LanguageSpecification
# prod-AssignmentRestElement
ECMAScript 2027 LanguageSpecification
# sec-function-definitions
ECMAScript 2027 LanguageSpecification
# sec-object-initializer
ECMAScript 2027 LanguageSpecification
# sec-property-accessors
ECMAScript 2027 LanguageSpecification
# sec-destructuring-binding-patterns
ECMAScript 2027 LanguageSpecification
# prod-BitwiseXORExpression
ECMAScript 2027 LanguageSpecification
# sec-new-operator
ECMAScript 2027 LanguageSpecification
# sec-unary-plus-operator
ECMAScript 2027 LanguageSpecification
# sec-exp-operator
ECMAScript 2027 LanguageSpecification
# sec-grouping-operator
ECMAScript 2027 LanguageSpecification
# prod-CoalesceExpression
ECMAScript 2027 LanguageSpecification
# prod-ArgumentList
ECMAScript 2027 LanguageSpecification
# prod-AssignmentRestProperty
ECMAScript 2027 LanguageSpecification
# sec-async-generator-function-definitions
ECMAScript 2027 LanguageSpecification
# sec-generator-function-definitions
ECMAScript 2027 LanguageSpecification
# prod-YieldExpression
ECMAScript 2027 LanguageSpecification
# prod-LogicalORExpression
ECMAScript 2027 LanguageSpecification
# sec-subtraction-operator-minus
ECMAScript 2027 LanguageSpecification
# prod-OptionalExpression
ECMAScript 2027 LanguageSpecification
# sec-class-definitions
ECMAScript 2027 LanguageSpecification
# sec-built-in-function-objects
ECMAScript 2027 LanguageSpecification
# sec-typeof-operator
ECMAScript 2027 LanguageSpecification
# sec-addition-operator-plus
HTML
# import-meta-resolve
HTML
# integration-with-the-javascript-module-system


Web Proxy Viewer  |  New URL  |  Original Page