3.js operator 1. Arithmetic operator 1.1 Description: JS arithmetic operators and most languages of the sum of the same operator, see example; 3 + 2//plus 3-2//minus 3 * 2//Multiply 3/2//except points[1].x-points[0].x//Access Previous Section object The value of: 1-0 =>1 "3" + "2"//+ can complete the addition operation or string connection/Same as Java function in the shorthand form of the arithmetic operator in 1.2js var count = 0; Define a variable count + +; Self-increment 1count-; Self minus 1count + = 2; Increment 2: The same as "Count = Count + 2" as Count *= 3; Increment 3: As with "Count = Count * 3", Count//=>6: The variable name itself is also an expression (not very clear why 6) 1.3 equals to the unequal operation var x = 2, y = 3; The equal sign here is the meaning of the assignment, as in other programming languages x = = y; =>false; unequal x! = y; =>true; unequal x < y; True;x <= y; true; less than or equal to X > y; false; greater than x >= y; False, greater than or equal to "two" = = "three"//false; two strings unequal "two" > "three"//true; " TW "The index in the alphabet is greater than" th "false = = (x > Y)//true;false and False equals 2. Logical operator 2.1 logical operator is a combination of Boolean values or negation (x = = 2) && (y = = 3)//true; two The comparison is true,&& "with" (X > 3) | | (Y < 3)//false; two comparisons not all true,| | means "or"! (x = = y)//true;! Seek counter
Operators for 3.js