By kent13304
via blog.trendics.com
Published: Aug 11 2008 / 17:42
Here are six essential string functions to extend the functions for strings in javascript...
By kent13304
via blog.trendics.com
Published: Aug 11 2008 / 17:42
Comments
kenman replied ago:
I don't know about "essential"...I've coded Javascript for 8 years and have never needed any of those.
Also, modifying Javascript primitives is not a wise thing to do unless you're in a small, static, 100% custom (i.e. no 3rd party libraries) environment.
dragmire replied ago:
I don't think small or static have anything to do with whether its wise to modify primitives. The prototype property was provided for a reason.
kenman replied ago:
My point was that a small application that doesn't use 3rd party libraries or code shouldn't really have a problem with it. It's when you start mixing in lots of external JS that you can run into trouble. How can you reliably guarantee that the 3rd-party code doesn't also make modifications to the natives? And when this code-collision happens, then what? Either your code is going to break some 3rd-party code, or some 3rd-party code is going to break your code. It WILL happen, but only when you least expect it (of course).
Voters For This Link (9)
Voters Against This Link (1)