Utilities


What are utilities ?

The utility is a small program installed separately and provides an addition to the existing features provided by the system. The utility is a small part that provides a specific feature that helps a lot. In jQuery, various utilities help reduce the code and make it useful. Utilities provided by jQuery are used to perform some javascript tasks easily.

Utilities Provided by jQuery

  • $.trim() : This is used to remove the whitespace from the head and trail of string.
  • $.each() : It is used to iterate over arrays and objects.
  • $.inArray() : inArray() is used to return an index in array and returns -1 if no element is present.
  • $.extend() : It is used to extend properties of an object using the subsequent object.
  • $.browser() : This returns the information of the browser.
  • $.data() : This is used to take the information of data.
  • $.fn.extend() : It is used to extend the jQuery prototype.
  • $.isWindow() : It is used to recognise the window.
  • $.now() : This shows the current time.
  • $.isXMLDoc() : Checks whether the document is of XML type or not.
  • $.globalEval() : This is used to execute javascript globally.
  • $.dequeue() : This executes the next function in the queue.
  • $.proxy() : It returns the function which always runs in scope. This sets the meaning of the inside passed function.
  • $.container() : This returns true if the DOM element provided by the second argument is descendant to first whether it is direct child or nested.