News for hackers. Stuff that matters.
Re:Ruby vs. Crystal Performance by gavinray on Friday June 05, 2020 @09:29PM (#23435993)
A JS integer is actually an instance of the "Number" object, you can to a small degree alter fundamental behavior even with primitive types
Re:Ruby vs. Crystal Performance by jiofih on Saturday June 06, 2020 @10:39AM (#23439487)
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).
Re:Ruby vs. Crystal Performance by ulucs on Saturday June 06, 2020 @10:40AM (#23439499)
You need to enclose numbers to access the prototype: 1.toString is undefined, whereas (1).toString() is "1"
Re:Ruby vs. Crystal Performance by hosh on Friday June 05, 2020 @11:23PM (#23436553)
I stand corrected.