Mastery Points
0
Active Mission
Mission: Identify the nuances of reference types vs primitive values to progress.
Objective: add N/A to the code
Current MissionIN PROGRESS
Riddle:Mission: Identify the nuances of reference types vs primitive values to progress.
33%
Reward: 50 XP Verified
Data Types in javascript
Context & Logic
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); // trueThis shows the difference between primitives (string, number, boolean) and reference types (arrays/objects), along with a few very common methods on each.
Test Your Knowledge
Assessment Mode1Which of the following is a reference type in JavaScript?