When I create a number using new Number() construct, what is the resulting data type? It seems to be neither float nor int.
I ran across this problem when I discrovered that one of my switch() statements did not work. It turned out that switch() uses strict comparison (===) internally. In other words,
new Number(1) !== parseInt(1);
new Number(1) !== parseFloat(1);
So, what the heck is the data type for the Number()?
Thanks!
I ran across this problem when I discrovered that one of my switch() statements did not work. It turned out that switch() uses strict comparison (===) internally. In other words,
new Number(1) !== parseInt(1);
new Number(1) !== parseFloat(1);
So, what the heck is the data type for the Number()?
Thanks!
Comment