Operatori de Referința JavaScript
Operatori de Referința JavaScript
Sau
JavaScript Operators Reference
Arithmetic operators are used to perform arithmetic between variables and/or values.
Given that x = 10 and y = 5, the table below explains the assignment operators:
Comparison operators are used in logical statements to determine equality or difference between variables or
values.
Syntax Example
Example explained: If the variable "age" is a value below 18, the value of the variable
"voteable" will be "Too young", otherwise the value of voteable will be "Old enough".
Logical Operators
Logical operators are used to determine the logic between variables or values.
Given that x = 6 and y = 3, the table below explains the logical operators:
The examples above uses 4 bits unsigned examples. But JavaScript uses 32-bit signed numbers.
Because of this, in JavaScript, ~ 5 will not return 10. It will return -6.