O'Reilly logo

CoffeeScript Programming with jQuery, Rails, and Node.js by Michael Erasmus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Utility functions

jQuery also comes with a host of utility functions that generally improves your day-to-day JavaScript programming experience. These are all in the form of methods on the global jQuery object like this: $.methodName. For instance, one of the most widely used utilities is the each method, that can be used to iterate over arrays or objects, and would be called as follows (in CoffeeScript):

$.each [1, 2, 3, 4], (index, value) -> alert(index + ' is ' + value)

jQuery's utility methods range from array and collection helper methods, time and string manipulation, as well as a host of other useful JavaScript and browser related functions. A lot of these functions stem from the everyday needs of a lot of JavaScript programmers.

Often, you'll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required