DEV Community

ihsaan muhammed
ihsaan muhammed

Posted on

PRIMITIVE VS NON-PRIMITIVE DATA TYPES IN JAVASCRIPT

WHAT IS DATA TYPE ??
Data types specify what kind of value a variable can store. In programming language JavaScript, data types are broadly classified into primitive and non-primitive types.

**
PRIMITIVE DATA TYPES**

PRIMITIVE DATA types are the basic types which can simply hold one single value

EXAMPLES
1) int
2)boolean
3)long
4)short

*NON-PRIMITIVE DATA TYPES *

NON-PRIMITIVE DATA TYPES are also called reference data types. They can store references to objects and can represent complex or collections of values

EXAMPLES
1)STRING
2)ARRAYS
3)CLASSES

Top comments (1)

Collapse
 
abimanyu_p_9e75124634d2a4 profile image
Abimanyu P • Edited

Bro, string is primitive