Day 2 of My JavaScript Visual Series 📚✨
Primitive vs Non-Primitive Data Types.
Let’s break it down like we’re explaining to a friend 👇
Ever got confused hearing “primitive” or “non-primitive” data types in JS?
I did too 😅
So here’s a short and super simple breakdown that finally made sense to me:
🧠 Primitive = Single Value (stored in stack, call by value)
Use my quick trick to remember: NN SS BB U
N - null
N - number
S - string
S - symbol
B - boolean
B - bigint
U - undefined
📦 Non-Primitive = Multiple values (stored in heap, call by reference)
These are your:
→ objects, arrays, and functions.
🧩 INTERVIEW STUFF YOU SHOULD KNOW
❓ Q: What’s the type of null in JS?
😲 It’s actually "object" — and yes, it’s a weird quirk of JavaScript.
❓ Q: Are integers and floats treated differently in JavaScript?
✅ No! Both are just number. JS doesn’t care if it's 10 or 10.5.
Let’s keep learning and sharing JS like this — no fluff, just real concepts with examples.
One day at a time 🌱
Top comments (0)