প্রাইমিটিভ: number, string, boolean, null, undefined, symbol, bigint। নন-প্রাইমিটিভ (রেফারেন্স টাইপ): Object, Array, Function।
উদাহরণ
var number = 10;
var stringValue = "John";
var booleanValue = true;
var obj = {};
var newArray = new Array();
console.log("The data type is=" + typeof number);
console.log("The data type is=" + typeof stringValue);
console.log("The data type is=" + typeof booleanValue);
console.log("The data type is=" + typeof obj);
console.log("The data type is=" + typeof newArray);
কমান্ড: node fileName.js
আউটপুট
PS C:\Users\Amit\JavaScript-code> node demo162.js The data type is=number The data type is=string The data type is=boolean The data type is=object The data type is=object