Search code examples
javascriptheap-memorystack-memory

Difference between primitive value and primitive type?


I'm always confused with the difference between these two things. I know primitive values are stored on the stack and reference values are stored on the heap. But is it accurate to say that primitive types store primitive values and vice versa with reference types/values?

Thanks


Solution

  • Hmm ... maybe you have a confusion with "primitive type". Most of the time "primitive type" (or primitive data type) and "primitive values" are used to speak the same things: boolean, null, undefined ...

    But you can check these links to know more about it and find a better answer: