0

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

2
  • 1
    Types are defined in ECMA-262, there is no "primitive type". It defines primitive values as a "member of one of the types Undefined, Null, Boolean, Number, BigInt, Symbol, or String", everything else is an Object (including functions, which are callable objects). Commented Aug 27, 2021 at 20:19
  • You know what the difference between a value and a type is in general? No, a type doesn't store anything. Commented Aug 27, 2021 at 22:04

1 Answer 1

1

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:

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.