The numerical types in JavaScript include string, number, Boolean, null, undefined, Symbol, object, array and function. Objects, arrays and functions are reference data types.
#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 为字符串
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!