JavaScript question detail
What are the differences between primitives and non-primitives?
JavaScript language has both primitives and non-primitives but there are few differences between them as below,
| Primitives | Non-primitives |
|---|---|
| These types are predefined | Created by developer |
| These are immutable | Mutable |
| Compare by value | Compare by reference |
| Stored in Stack | Stored in heap |
| Contain certain value | Can contain NULL too |