The content of this article is to introduce what types of operators are divided into in JavaScript? What are the differences? It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
There are arithmetic operators, assignment operators, comparison operators, logical operators, bit operators, unary operators and other operators in JavaScript
Arithmetic operators:
Assignment operator:
Comparison operator:
Logical operators:
Bit operators:
In addition, there is also the typeof operator, which can return variables Or the type of expression:
console.log(typeof 1); //num console.log(typeof 'Mark'); //string console.log(typeof true); //boolean console.log(typeof [1,2,3]); //object console.log(typeof {name:'Mark'}); //object
javaScript also supports the delete operator, which can delete attributes in the object:
var myObj = {name:'Mark',age:18}; delete myObj.age; console.log(myObj); //{name:'Mark'}
The above is the detailed content of What types of operators are divided into in js? What are the differences?. For more information, please follow other related articles on the PHP Chinese website!