Home > Article > Web Front-end > What are the basic data types of JS?
The basic data types of JS are as follows: Number, String, Boolean, Null, and Undefined.
let num1 = 10; // 整数 let num2 = 3.14; // 浮点数
let str1 = 'Hello'; // 使用单引号 let str2 = "World"; // 使用双引号
let isTrue = true; // 真 let isFalse = false; // 假
let emptyValue = null;
let undefinedValue;
The above are the basic data types of JS and their corresponding code examples. In actual development, we often use these data types to store and operate different data.
The above is the detailed content of What are the basic data types of JS?. For more information, please follow other related articles on the PHP Chinese website!