Link Details

Link 102587 thumbnail
User 209395 avatar

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...
  • 9
  • 1
  • 2363
  • 797

Comments

Add your comment
User 204084 avatar

kenman replied ago:

0 votes Vote down Vote up Reply

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.

User 256617 avatar

dragmire replied ago:

0 votes Vote down Vote up Reply

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.

User 204084 avatar

kenman replied ago:

0 votes Vote down Vote up Reply

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).

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (9)



Voters Against This Link (1)