0
What is the difference between primitive data type and reference data type?
data type in javascript
5 Answers
+ 3
This is a good explanation
https://docstore.mik.ua/orelly/webprog/jscript/ch04_04.htm
+ 3
The difference comes from how they are stored in the RAM.
Primitive data types are stored on the Stack, Reference d.t. - on the Heap.
Java example:
Stack Heap
char Objects
byte Strings
short Arrays
int Lists
long Maps
float
double
More about the Stack and Heap:
http://net-informations.com/faq/net/stack-heap.htm
0
Boris Batinkov Why are String in heap?
0
Aman sharma,
Simply said, because a String is like an Array of chars.
Check the link about the stack and heap above. It explains the difference between the Stack and Heap, so you'll understand it better.
0
Boris Batinkov thank you đ