typeof operators in JavaScript

In this article, you will learn the list of typeof operators in JavaScript. The typeof operator is used to get the type of the provided operand as a string.

Syntax

The syntax for the typeof operator.

operand: an expression whose type is to be returned.

List of the different JavaScript datatypes

  1. String
  2. Number
  3. BigInt
  4. Boolean
  5. Undefined
  6. Object
  7. Array
  8. Function
  9. null

1. String

2. Number

3. BigInt

4. Boolean

5. Undefined

6. Object

7. Array

Note: The type of Array is Object!

To detect if an expression is an array, use the Array.isArray() method.

8. Function

9. null

Note: The type of null is Object!

I hope you find this article helpful.
Thank you for reading. Happy Coding..!! 🙂

If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *