You should checkout http://underscorejs.org/ for some useful utility functions :-)