Joined December 2013

Aleksander Ciesiołkiewicz

Experienced Frontend and PHP Developer at Perform Group

@jailbot - all numbers in JavaSript are instances of Number.
Also NaN (not-a-number) is an instance of a Number.

One note here:
If you type e.g.
x = 3;
x won't be an instance of Number. It won't be an object at all. But if you try do deal with it as with a Number


x will be converted to Number on the fly.

@hauleth - yeah, I know it's a Number after all. The point of that tip was to show the different ways of solving single problem and using bitwise operations is just a fast way:

I also wanted to point the differences between those methods so readers can be aware of those and avoid surprises in the future.

But thanks to you I have learned something new today - thank's for that ;]

@hauleth - it really is simple however it doesn't convert a string to an integer but to a floating-point number:

str = '3.75';
+str; // returns 3.75
229 Karma
24,637 Total ProTip Views
Interests & Skills