Data Types in javascript

JavaScript has primitive types (string, number, boolean, null, undefined, bigint, symbol) and reference types (objects, arrays, functions). Primitives are copied by value, objects by reference. Every type comes with helpful built-in methods (for example, String.prototype.toUpperCase, Number.prototype.toFixed, Array.prototype.map).

Example

const name = "Punam";           // string
const age = 25;                 // number
const isDev = true;             // boolean
const scores = [10, 20, 30];    // array (object)

// Some common helpers
name.toUpperCase();             // "PUNAM"
age.toFixed(1);                 // "25.0"
scores.includes(20);            // true

This shows the difference between primitives (string, number, boolean) and reference types (arrays/objects), along with a few very common methods on each.