Lesson 5 of 6
Data Types in JavaScript

By Ashutosh Anand Tiwari09 Apr, 2024 · 2 min read

Interviewer : Tell me all data types in JavaScript?
You: There are total 8 built in data types in JavaScript.
- string
- number
- boolean
- null
- undefined
- object
- symbol ( ES6 feature)
- bigInt
typeof Operator
JavaScripts Provides typeof operator to check the value and its type
var a;
typeof a; // undefined ( because there is no value in it)
a ='JS Snippets'
typeof a; // string
a=23;
typeof a; // number
a= undefined;
typeof a; // undefiend
a= true;
typeof a; // boolean
a= null;
typeof a; // object ( this is bug in JS, Google it to learn more about it)
a= {name:'Ashutosh'}
typeof a; // object
Request a Topic
Want me to write notes on a course?
Tell me the course, book, or research topic you want covered. If it helps learners, I'll consider adding structured digital notes for it in the garden.
Collaborate
Have a notes collection to feature here?
Do you have open notes you want featured in this digital garden? Let me know — we can collaborate and publish them for learners worldwide.
Reach out on Topmate: topmate.io/aat
Contact to Collaborate