Mini App Document Mini App Document
  • Start
  • Configuration
  • Framework
  • Custom Components
  • Basic ability
  • Configuration
  • Interface
  • FXML syntax
  • FXS syntax
API
Components
IDE
  • Developer
  • Operator
  • Start
  • Configuration
  • Framework
  • Custom Components
  • Basic ability
  • Configuration
  • Interface
  • FXML syntax
  • FXS syntax
API
Components
IDE
  • Developer
  • Operator
  • Configuration

  • Interface

  • FXML syntax

  • FXS syntax

    • Introduction to FXS
    • Module
    • Variable
    • Comment
    • operator
      • Basic operator
        • Sample code
      • Unary operators
        • Sample code
      • bitwise operator
        • Sample code
      • Comparison operators
        • Sample code
      • Equal value operator
        • Sample code
      • Assignment operator
        • Sample code
      • Binary logical operators
        • Sample code
      • Other operators
        • Sample code
      • Operator precedence
    • statement
    • Data type
    • Base class library
  • Framework
  • FXS syntax
2022-08-09
Directory

operator

# Basic operator

# Sample code

var a = 10, b = 20;

Addition operations
console.log(30 === a + b);
Subtraction
console.log(-10 === a - b);
Multiplication
console.log(200 === a * b);
Division operations
console.log(0.5 === a / b);
The remainder operation
console.log(10 === a % b);
var a = '.w' , b = 'xs';

String stitching
console.log('.wxs' === a + b);

# Unary operators

# Sample code

var a = 10, b = 20;

Auto-increment operations
console.log(10 === a++);
console.log(12 === ++a);
Decrement operation
console.log(12 === a--);
console.log(10 === --a);
Positive value operations
console.log(10 === +a);
Negative value operations
console.log(0-10 === -a);
No operation
console.log(-11 === ~a);
Take the inverse operation
console.log(false === !a);
Delete operation
console.log(true === delete a.fake);
Void operation
console.log(undefined === void a);
Typeof operation
console.log("number" === typeof a);

# bitwise operator

# Sample code

var a = 10, b = 20;

Shift left operation
console.log(80 === (a << 3));
The signed right shift operation
console.log(2 === (a >> 2));
Unsigned right shift operation
console.log(2 === (a >>> 2));
and operations
console.log(2 === (a & 3));
XOR operations
console.log(9 === (a ^ 3));
or operations
console.log(11 === (a | 3));

# Comparison operators

# Sample code

var a = 10, b = 20;

Less than
console.log(true === (a < b));
Greater than
console.log(false === (a > b));
Less than or equal to
console.log(true === (a <= b));
Greater than or equal to
console.log(false === (a >= b));

# Equal value operator

# Sample code

var a = 10, b = 20;

equal sign
console.log(false === (a == b));
Non-equal sign
console.log(true === (a != b));
Full equal sign
console.log(false === (a === b));
Non-full equal sign
console.log(true === (a !== b));

# Assignment operator

# Sample code

var a = 10;

a = 10; a *= 10;
console.log(100 === a);
a = 10; a /= 5;
console.log(2 === a);
a = 10; a %= 7;
console.log(3 === a);
a = 10; a += 5;
console.log(15 === a);
a = 10; a -= 11;
console.log(-1 === a);
a = 10; a <<= 10;
console.log(10240 === a);
a = 10; a >>= 2;
console.log(2 === a);
a = 10; a >>>= 2;
console.log(2 === a);
a = 10; a &= 3;
console.log(2 === a);
a = 10; a ^= 3;
console.log(9 === a);
a = 10; a |= 3;
console.log(11 === a);

# Binary logical operators

# Sample code

var a = 10, b = 20;

Logically
console.log(20 === (a && b));
Logical or
console.log(10 === (a || b));

# Other operators

# Sample code

var a = 10, b = 20;

Conditional operators
console.log(20 === (a >= 10 ? a + 10 : b + 10));
Comma operator
console.log(20 === (a, b));

# Operator precedence

Priority Operator Description Binding
20 ( ... ) Parentheses n/a
19 ... . ... Members access the From left to right
... [ ... ] Members access the From left to right
... ( ... ) The function call From left to right
17 ... ++ Post-increment n/a
... -- Post-decreasing n/a
16 ! ... Logical non- Right-to-left
~ ... Bitwise non- Right-to-left
+ ... Unary addition Right-to-left
- ... Unary subtraction Right-to-left
++ ... Precursion Right-to-left
-- ... Prepends decrement Right-to-left
typeof ... typeof Right-to-left
void ... void Right-to-left
delete ... delete Right-to-left
14 ... * ... Multiply From left to right
... / ... Division From left to right
... % ... Take the mold From left to right
13 ... + ... Addition From left to right
... - ... Subtraction From left to right
12 ... << ... Shift left by bit From left to right
... >> ... Shift right by bit From left to right
... >>> ... Unsigned to move right From left to right
11 ... < ... Less than From left to right
... <= ... Less than or equal to From left to right
... > ... Greater than From left to right
... >= ... Greater than or equal to From left to right
10 ... == ... The equal sign From left to right
... ! = ... Non-equal sign From left to right
... === ... Full equal sign From left to right
... ! == ... Not a full equal sign From left to right
9 ... & ... Bitwise and From left to right
8 ... ^ ... By bit or From left to right
7 ... | ... Bitwise or From left to right
6 ... && ... Logic and From left to right
5 ... || ... Logical or From left to right
4 ... ? ... : ... Conditional operator Right-to-left
3 ... = ... Assign a value Right-to-left
... += ... Assign a value Right-to-left
... -= ... Assign a value Right-to-left
... *= ... Assign a value Right-to-left
... /= ... Assign a value Right-to-left
... %= ... Assign a value Right-to-left
... <<= ... Assign a value Right-to-left
... >>= ... Assign a value Right-to-left
... >>>= ... Assign a value Right-to-left
... &= ... Assign a value Right-to-left
... ^= ... Assign a value Right-to-left
... |= ... Assign a value Right-to-left
0 ... , ... Comma From left to right
Last update: 2022/08/11, 20:42:12
Comment
statement

← Comment statement→

Copyright © 2020-2024 Neuxnet
  • Follow System
  • Light Mode
  • Dark Mode
  • Reading Mode