Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a javascript library that contains a rich set of very high level commonly used functions?

I find that many high level functions are missing in most well-known javascript libraries such as jquery, YUI...etc. Taking string manipulation as an example, startsWith, endsWith, contains, lTrim, rTrim, trim, isNullOrEmpty...etc. These function are actually very common ones.

I would like to know if there exists a javascript library/ plugin of a javascript library that fills these gaps (including but not limited to string manipulation)?

It would be great if the library does not override the prototype.

like image 436
bobo Avatar asked Apr 18 '10 05:04

bobo


3 Answers

Take a look at underscore.js (sadly, no string manipulation, but lots of other good stuff).

like image 133
itsadok Avatar answered Sep 23 '22 09:09

itsadok


Most of those string functions are available using other methods associated with the string object eg

var myString = 'hello world';

myString.indexOf('hello') == 0; //same as startsWith('hello');

You could wrap these functions up into other functions if you wish. I think adding prototypes to the string object would be the way to go there and any libraries you find will probably go down that route anyway.

like image 32
James Westgate Avatar answered Sep 20 '22 09:09

James Westgate


The ms ajax core library contains all of those string methods as well as date methods etc. basically a valiant attempt at bringing .net to js.

You don't need to load the entire MS Ajax js stack, just the core file.

like image 21
Sky Sanders Avatar answered Sep 21 '22 09:09

Sky Sanders