4 ms·
The point is that the language treats numbers as objects when they aren't. It's not that reference semantics don't have a place, it's just that the place isn't
by hyperpape 9y ago
The point is that the language treats numbers as objects when they aren't.
It's not that reference semantics don't have a place, it's just that the place isn't numbers.
As for your second question, it looks like the type system has two embarrassing questions: what the heck does "new Object()" mean? Nothing worth saying.
- chrisseaton 9y agoI use `new Object()` in my code and I use it exactly for identity equality! If I want a unique ID for something I create a new object and it's guaranteed it will never be reference equality to any other object anyone else could construct.