Primitive vs. Reference Values

Adnan Ahmed
3 min readDec 9, 2020

In javascript, a variable may store two types of values: primitive and reference. So before we discuss them let’s first discuss two important concepts stack and heap.

Stack

In layman’s terms, a stack is a pile of objects. In computing, architecture stacks are basically regions of memory where data is added or removed in a last in first out manner (LIFO).

--

--

Adnan Ahmed

A software engineer sharing insights and experiences through blog posts. Delving into technical topics and occasional general musings. https://adnanahmed.info