Skip to main content

Các kiểu dữ liệu trong Javascript 🎉

#Data TypeDesc
1numberint or float, integers are limited by ±(2^53-1)
2bigintis for integer numbers of arbitrary length.
3stringfor strings, no single character type
4booleanfor true / false
5nullfor unknown values – a standalone type that has a single value null.
6undefinedfor unassigned values – a standalone type that has a single value undefined.
7symbolfor unique identifiers.
8objectNON-Primitive type, used for complex data structure
const age = 18;
const name = 'Easy Frontend';
const isActive = true;

const student = {
name: 'Po',
age: 18,
}

let powerfulVar; // count will be undefined
powerfulVar = 1;
powerfulVar = 'Hello';
powerfulVar = true;
powerfulVar = {
name: 'crazy javascript =)))'
};

typeof operator

Tham khảo: https://javascript.info/types