Welcome Guest! (App Version 3.1)
List of JS inbuilt MethodsInbuilt Methods in JS String Methods Array Methods Number Methods Math Methods Boolean Methods Regexp Methods
Ajax CallsRest APIs JSON Format Making Service Calls
Advanced JSObject Oriented JS Inheritance in JS Prototypal Inheritance Polymorphism Encapsulation & DA Anonymous Functions IIFE Closures Objects in JS How to create Objects in JS Scope in JS Types of Scope Hoisting Context in JS Concept of 'This' Call, Apply, Bind Asynchronous Operations Callbacks Promises
JS QuizJS Quiz 1
Data types are the main building blocks of any computer language. These are basically the formats to store data in the form of variables.
Primitive: This includes 6 of the data-types:
Non-Primitive: This includes 1 data-type:
As we have already seen all the values of data-types excluding object are immutable (which means, they cannot be changed). Consider the following:
|1||String||"Peter"||Represents a string like name or address|
|2||Number||81||Represents a number or a variable like age or marks in a subject|
|3||Boolean||true||Represents one of the 2 options, either, true or false.|
|5||Undefined||undefined||Represents a variable not assigned any value, so default comes with undefined|
|6||Symbol||symbol||Added in ECMA6, with the new data type.|
An Object is only 'Non-Primitive' data type and its values are mutable or changeable. Object is a collection of properties which can be changed at times. Object helps to contain complex data in a single entity with the help of its properties. Easiest way to make object is using object literal initializing it with limited set of properties. Later while coding and making functions, properties may be added or removed to it as per requirement.