Home > Web Front-end > JS Tutorial > body text

What types of operators are divided into in js? What are the differences?

青灯夜游
Release: 2018-10-23 16:51:52
forward
1862 people have browsed it

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:

What types of operators are divided into in js? What are the differences?

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
Copy after login

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'}
Copy after login

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!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!