• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

JavaScript Data Types and Keywords

JavaScript Data Types

JavaScript is a dynamic or loosely typed language, means we don't need to specify type of the variable because it is dynamically specified by JavaScript engine based on the type of input. We just need to use var or let keyword to create variable. There are basically two types of data type in JavaScript, which are given below-

Primitive Data Types:- There are besically five types of primitive data type in JavaScript, which are given below-

Data TypesDescription
StringIt represents any string (example "hello").
NumberIt represents any numeric value (example 777).
BooleanIt represents boolean value (example true or false).
UndefinedIt represents undefined value.
NullIt represents null value.

Non-primitive or Reference Data Types There are besically two types of non-primitive data type in JavaScript, which are given below-

Data TypesDescription
ArrayIt represents multiple values of same or different data types in a single variable.
ObjectIt represents instance by which we can access members.

JavaScript Keywords

JavaScript keywords are reserved words, which we cannot use to name the variables or functions. There are total of 63 keywords which JavaSscript provides to the programmers.

Keywords
abstractargumentsbooleanbreak
bytecasecatchchar
constcontinueclass*debugger
defaultdeletedodouble
elseevalenum*export*
extends*falsefinalfinally
floatforfunctiongoto
ifimplementsininstanceof
intinterfaceimport*let
longnativenewnull
packageprivateprotectedpublic
returnshortstaticswitch
synchronizedsuper*thisthrow
throwstransienttruetry
typeofvarvoidvolatile
whilewithyield-

Keywords, which are marked with * symbols are the new keywords in ECMAScript 5 and 6.