What are the data t…
 
Notifications
Clear all

What are the data types supported by JavaScript?

1 Posts
2 Users
0 Likes
413 Views
0
Topic starter

Explain briefly.

1 Answer
0

A datatype is a classification that specifies the type of value/data that a variable holds. 

Datatypes can be classified into two types:

  • Primitive
    1. String: “Akshaj”, “hello”
    2. Number: 45, 9.2, 1
    3. Boolean: True, False
    4. Null
    5. Undefined: No value has been assigned
    6. Symbol
  • Non-primitive
    1. Object: Person = {age: 21, name: “akshaj”}
    2. Array: numbersTillFive = [0,1,2,3,4,5]
    3. Function: drawCircle()
Share: