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

What are the numerical types in javascript

王林
Release: 2023-01-07 11:42:36
Original
2057 people have browsed it

The numerical types in JavaScript include string, number, Boolean, null, undefined, Symbol, object, array and function. Objects, arrays and functions are reference data types.

What are the numerical types in javascript

#The operating environment of this article: windows10 system, javascript 1.8.5, thinkpad t480 computer.

There are two types of numerical types in JavaScript: value types and reference data types.

Value type (basic type): String, Number, Boolean, Null, Undefined, Symbol.

Reference data types: Object, Array, Function.

JavaScript has dynamic typing. This means that the same variable can be used as different types.

Look at the example:

var x;               // x 为 undefined
var x = 5;           // 现在 x 为数字
var x = "John";      // 现在 x 为字符串
Copy after login

Related video tutorial sharing: javascript video tutorial

The above is the detailed content of What are the numerical types in javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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!