js operator

js operators have unary operators, bit operators, boolean operators, multiplication operators, addition operators, relational operators, equality operators

conditional operator, assignment operator,

It is worth noting that both the unary operator and the equality operator may change the numeric type of the operand. The difference between operators in js is that

They can work with many values, such as strings, numbers, booleans, and even objects. However, when applied to an object, the corresponding operator will

Call the object's valueof() method or toString method to convert it to an operable data type.

logic&&

a = {};

b= 9;

a&&b // 9 returns operand

b&&a // a returns the object


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325942576&siteId=291194637
Recommended