why you should basically never use the Number constructor
¶ by Rob FrieselInspired by some recent entanglements with a vendor’s API:
The type coercion will ultimately work in your favor but the main point is that the type coercion has to take place in the first place. Granted, it is probably an edge case 1 to do something like:
…but you never know. There’s some strange code out there 2.
- And therefore you get what you deserve?[↩]
- And by that I mean: Don’t be one of the ones writing it.[↩]
About Rob Friesel
Software engineer by day. Science fiction writer by night. Weekend homebrewer, beer educator at Black Flannel, and Certified Cicerone. Author of The PhantomJS Cookbook and a short story in Please Do Not Remove. View all posts by Rob Friesel →3 Responses to why you should basically never use the Number constructor
Pingback: an annotated guide to the Google JavaScript Style Guide at found_drama
Pingback: Linkdump for December 2nd | found drama
Leave a Reply