I came across this looking at the source for some physics animations in JavaScript found here on github where he's written this
if (this._position < 0) this._position /= 3;
A quick Google yielded nothing, anyone know?
In JavaScript, an operator is a special symbol used to perform operations on operands (values and variables). For example, 2 + 3; // 5. Here + is an operator that performs addition, and 2 and 3 are operands.
The strict equality operator ( === ) checks whether its two operands are equal, returning a Boolean result.
In Python, there are seven different types of operators: arithmetic operators, assignment operators, comparison operators, logical operators, identity operators, membership operators, and boolean operators.
The operator is shorthand division operator. It is equivalent to
this.position = this.position / 3;
The division will be performed first and then the result will be assigned to the dividend.
Quoting from MDN
The division assignment operator divides a variable by the value of the right operand and assigns the result to the variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With