Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gavinray
on June 6, 2020
|
parent
|
context
|
favorite
| on:
Ruby vs. Crystal Performance
A JS integer is actually an instance of the "Number" object, you can to a small degree alter fundamental behavior even with primitive types
jiofih
on June 6, 2020
|
next
[–]
No it is not. It is a primitive, this difference is well defined in the ECMAScript spec. Same for strings. An instanceof String is strictly
not
the same as a string primitive (and there are runtime consequences).
_v7gu
on June 6, 2020
|
prev
|
next
[–]
You need to enclose numbers to access the prototype: 1.toString is undefined, whereas (1).toString() is "1"
hosh
on June 6, 2020
|
prev
[–]
I stand corrected.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: