Primitive vs. Reference Values
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).