📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials jQuery in Practice Utility Functions

Utility Functions

5 min read
jQuery utilities include $.isArray(), $.type(), $.trim(), $.inArray(), and $.extend(). Most have modern vanilla JS equivalents but are still useful for consistency when working in existing jQuery codebases.

jQuery Utilities

$.isArray([1,2,3]);          // true
$.isFunction(fn);            // true
$.type(null);                // 'null'
$.trim('  hello  ');        // 'hello'
$.inArray(2, [1,2,3]);       // 1 (index)
$.extend({}, obj1, obj2);   // merge objects
$.parseJSON(str);            // parse JSON string
$.now();                     // timestamp