Quantcast
Channel: Java Team at Kentor » Frameworks
Viewing all articles
Browse latest Browse all 26

_Underscore.js

$
0
0

underscore

  is a utility library for Javascript with a functional programming approach. It provides around 80-odd functions. It could be divided into three categories. The first category is the  one that are       already provided by jQuery; the second category are the ones which we wish we could have; and the third category are the ones which are nice to have but  rarely used.

Anyway the library itself is very light-weight and size-wise it’s around 5-6 KB. The question is how does it fit together with jQuery/backbone.js

jQuery will take care of most of your dom manipulation

backbone.js will help you organize all of your code and give your js application some structure (mvc pattern)

underscore.js will give you really useful low-level utility functions. Backbone.js uses it and it’s from the same developer.

Documentation is really good and easy to follow. In a nutshell it provides:

Collections: each,map,reduce,reduceRight,find,filter,reject,all,any,include,invoke,pluck,max,min,sortBy,groupBy,sortedIndex,shuffle,toArray,size

Array: first,initial,last,rest,compact,flatten,without,union,intersection,difference,uniq,zip,indexOf,lastIndexOf,range

Function: bind,bindAll,memoize,delay,defer,throttle,debounce,once,after,wrap,compose

Object: keys,values,functions,extend,defaults,clone,tap,isEqual,isEmpty,isElement,isArray,isArguments,isFunction,isString,isNumber,isBoolean,isDate,isRegExp,isNaN,isNull,isUndefined

Utitity: noConflict,identity,times,mixin,uniqueId,escape,template



Viewing all articles
Browse latest Browse all 26

Trending Articles