-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07.js
More file actions
30 lines (23 loc) · 753 Bytes
/
07.js
File metadata and controls
30 lines (23 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 🧠 JavaScript has 7 primitive data types:
// 1️⃣ String
let name = "Surya";
console.log(typeof name); // "string"
// 2️⃣ Number
let age = 25;
let price = 99.99;
console.log(typeof age); // "number"
// 3️⃣ Boolean
let isStudent = true;
console.log(typeof isStudent); // "boolean"
// 4️⃣ Null (intentional empty value)
let data = null;
console.log(typeof data); // "object" ✅ (JS quirk)
// 5️⃣ Undefined (value not assigned yet)
let score;
console.log(typeof score); // "undefined"
// 6️⃣ Symbol (unique identifier)
let sym = Symbol("id");
console.log(typeof sym); // "symbol"
// 7️⃣ BigInt (for very large integers)
let bigNum = 1234567890123456789012345678901234567890n;
console.log(typeof bigNum); // "bigint"