JavaScript ডেটা টাইপস
• জাভাস্ক্রিপ্টে দুটি প্রধান ধরনের ডেটা টাইপ রয়েছে:
• 1. Primitive
• 2. Non-Primitive (Reference)
Primitive Data Types
• 👉 Number
• 👉 String
• 👉 Boolean
• 👉 Undefined
• 👉 Null
• 👉 BigInt
• 👉 Symbol
Primitive Type উদাহরণ
• let a = 42;
• let b = "JavaScript";
• let c = true;
• let d;
• let e = null;
• let f = 12345678901234567890n;
• let g = Symbol("id");
Non-Primitive Data Types
• 👉 Object
• 👉 Array
• 👉 Function
Non-Primitive উদাহরণ
• let person = { name: "Ashik", age: 25 };
• let fruits = ["Apple", "Banana"];
• function greet() { console.log("Hello!"); }
typeof দিয়ে টাইপ চেক
• typeof "Hello" // "string"
• typeof 123 // "number"
• typeof true // "boolean"
• typeof undefined // "undefined"
• typeof null // "object"
• typeof {} // "object"
• typeof [] // "object"
• typeof function(){} // "function"
Common Confusions
• 🔸 typeof null → "object" (bug)
• 🔸 Array is a type of Object
• 🔸 typeof NaN → "number"
Practice Exercise
• let a;
• console.log(typeof a); // ?
• let b = null;
• console.log(typeof b); // ?
• let nums = [1, 2, 3];
• console.log(typeof nums); // ?
Q&A Ideas
• ✅ Primitive vs Non-Primitive এর পার্থক্য
• ✅ typeof null এর মান
• ✅ Function এর টাইপ কী?
Quiz Questions
• 1. Which is primitive?
• A. Object B. Array C. Symbol ✅ D. Function
• 2. typeof null?
• A. 'null' B. 'object' ✅ C. 'undefined' D. 'symbol'