In various answers on this site I have read conflicting statements about whether everything in JavaScript is an object or not.
What is the truth?
The idea is that the answers are based on reliable sources, preferably in the ECMAScript 2016 (version 7) but it may well be the one in which a specification element has been introduced in this regard.
Here are a couple of examples of each case
everything is an object
- Response to Swapping two objects by changing the result in JavaScript
- Answer to How does the prototype of an object work? 1
not everything is an object
- Answer to Why does instanceof of a literal number return false?
- Response to Arguments in functions (Javascript - ES5)
Ambiguous
- Answer to Inheritance of properties and methods according to data types
- The answer mentions that primitives can use methods "of their data type".
General note:
Although this question has an answer from me, the idea is to have the best explanation on this for the benefit of the community.
Specific Notes:
1 : This question has been marked as a duplicate because it was believed that the answer to this question is in the referenced answer, however, it is precisely pointing out the controversy that exists considering the answers to other questions. On the other hand, this answer does not base its arguments on external sources.