Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

JavaScript data types and data structures Tutorial

JavaScript data types and data structures Tutorial

In this tutorial we are going to discuss JavaScript variables that can hold many data types. There are two types of JavaScript data types Primitive and Non-Primitive. Primitive includes six data types (As per ECMAScript 6)

  1. Null
  2. Undefined
  3. Boolean
  4. Number
  5. String
  6. Symbol

The Non-Primitive data type includes Object,Array and RegExp(Regular Expression). To describe  Non-Primitive data type require seperate post for each so in upcoming tutorials we will learn Object,Array and RegExp .

Primitive data type

Data TypeDescription / Reference
NULLNULL means no value at all
UndefinedUndefined means undefined value like 20/0
BooleanBoolean means either false or true
NumberNumber represents numeric values e.g. 100
StringNumber represents sequence of characters e.g. “hello 2345 #%”
SymbolA symbol is a unique and immutable data type and may be used as an identifier for object properties. The symbol object is an implicit object wrapper for the symbol primitive data type.

Non-Primitive data type

Data TypeDescription / Reference
Objectrepresents instance through which we can access members
Arrayrepresents group of similar values or data types
RegExprepresents regular expression

Remember  : JavaScript is a dynamic type language, means you don’t need to specify type of the variable because it is dynamically used by JavaScript engine. You need to use var here to specify the data type. It can hold any type of values such as numbers, strings etc.

For Example:

var x=50; //holding number represent number
var b="JavaScript is Dynamic"; //holding string


0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments