Advertisement
728x90
You can use the JavaScript typeof operator to find the type of a JavaScript variable. It returns the type of a variable or an expression.
javascript
1typeof "John Abraham"; // Returns "string"
2
3typeof (1 + 2); // Returns "number"
4
5typeof [1, 2, 3]; // Returns "object" because all arrays are also objectsAdvertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 73
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
72of476