DEV Community

Pranay Rebeyro
Pranay Rebeyro

Posted on

JavaScript

JavaScript is a lightweight, interpreted programming language used primarily to make web pages interactive and dynamic.JavaScript first name was "MOCHA".

DATA TYPES
JavaScript data types are divided into two categories.

  1. Primitive Type - String,Number,Boolean,BigInt,Undefined,Null,Symbol

  2. Non-Primitive Type - Arrays,Objects,Functions

Word - String
Number - number
Large no - BigInt
true/false - boolean

How to Check a Data Type?
JavaScript provides the typeof operator.


eg: let age = 25;

console.log(typeof age);

output: number
Enter fullscreen mode Exit fullscreen mode

Static Typing
Languages like Java use Static Typing.

eg: int age = 25; // Here we must add which datatype the value  blongs to.
Enter fullscreen mode Exit fullscreen mode

Dynamic Typing
Languages like JavaScript, Python use Static Typing.

`eg: age = 25; // Here we need not to mention the data type.`
Enter fullscreen mode Exit fullscreen mode

Top comments (0)