共用方式為


JScript Operators (Windows Scripting - JScript)

 

The following table lists JScript operators.

Operators

Description

Language Element

Adds the value of an expression to the value of a variable and assigns the result to the variable.

Addition Assignment Operator (+=)

Sums two numbers or concatenates two strings.

Addition Operator (+)

Assigns a value to a variable.

Assignment Operator (=)

Performs a bitwise AND on the value of a variable and the value of an expression and assigns the result to the variable.

Bitwise AND Assignment Operator (&=)

Performs a bitwise AND on two expressions.

Bitwise AND Operator (&)

Shifts the bits of an expression to the left.

Bitwise Left Shift Operator (<<)

Performs a bitwise NOT (negation) on an expression.

Bitwise NOT Operator (~)

Performs a bitwise OR on the value of a variable and the value of an expression and assigns the result to the variable.

Bitwise OR Assignment Operator (|=)

Performs a bitwise OR on two expressions.

Bitwise OR Operator (|)

Shifts the bits of an expression to the right, maintaining sign.

Bitwise Right Shift Operator (>>)

Performs a bitwise exclusive OR on a variable and an expression and assigns the result to the variable.

Bitwise XOR Assignment Operator (^=)

Performs a bitwise exclusive OR on two expressions.

Bitwise XOR Operator (^)

Causes two expressions to be executed sequentially.

Comma Operator (,)

Returns a Boolean value indicating the result of the comparison.

Comparison Operators

List of compound assignment operators.

Compound Assignment Operators

Executes one of two expressions depending on a condition.

Conditional (ternary) Operator (?:)

Decrements a variable by one.

Decrement Operator (--)

Deletes a property from an object, or removes an element from an array.

delete Operator

Divides the value of a variable by the value of an expression and assigns the result to the variable.

Division Assignment Operator (/=)

Divides two numbers and returns a numeric result.

Division Operator (/)

Tests for the existence of a property in an object.

in Operator

Compares two expressions to determine if they are equal.

Equality Operator (==)

Compares two expressions to determine if one is greater than the other.

Greater than Operator (>)

Compares two expressions to determine if one is greater than or equal to the other.

Greater than or equal to Operator (>=)

Compares two expressions to determine if they are equal in value and of the same data type.

Identity Operator (===)

Increments a variable by one.

Increment Operator (++)

Compares two expressions to determine if they are unequal.

Inequality Operator (!=)

Returns a Boolean value that indicates whether or not an object is an instance of a particular class.

instanceof Operator

Left shifts the value of a variable by the number of bits specified in the value of an expression and assigns the result to the variable.

Left Shift Assignment Operator (<<=)

Compares two expressions to determine if one is less than the other.

Less than Operator (<)

Compares two expressions to determine if one is less than or equal to the other.

Less than or equal to Operator (<=)

Performs a logical conjunction on two expressions.

Logical AND Operator (&&)

Performs logical negation on an expression.

Logical NOT Operator (!)

Performs a logical disjunction on two expressions.

Logical OR Operator (||)

Divides the value of a variable by the value of an expression, and assigns the remainder to the variable.

Modulus Assignment Operator (%=)

Divides two numbers and returns the remainder.

Modulus Operator (%)

Multiplies the value of a variable by the value of an expression and assigns the result to the variable.

Multiplication Assignment Operator (*=)

Multiplies two numbers.

Multiplication Operator (*)

Creates a new object.

new Operator

Compares two expressions to determine that they are not equal in value or of the same data type.

Nonidentity Operator (!==)

Right shifts the value of a variable by the number of bits specified in the value of an expression, maintaining the sign, and assigns the result to the variable.

Right Shift Assignment Operator (>>=)

Subtracts the value of an expression from the value of a variable and assigns the result to the variable.

Subtraction Assignment Operator (-=)

Performs subtraction of two expressions.

Subtraction Operator (-)

Returns a string that identifies the data type of an expression.

typeof Operator

Indicates the negative value of a numeric expression.

Unary Negation Operator (-)

Right shifts the value of a variable by the number of bits specified in the value of an expression, without maintaining sign, and assigns the result to the variable.

Unsigned Right Shift Assignment Operator (>>>=)

Performs an unsigned right shift of the bits in an expression.

Unsigned Right Shift Operator (>>>)

Prevents an expression from returning a value.

void Operator

See Also

Operator Precedence (Windows Scripting - JScript)