Show Menu

jQuery Utility Functions: Type Testing Cheat Sheet by

Overview of jQuery's type testing utility functions.
programming     javascript     jquery

Use Cases

Dete­rmine the type of an object
Allow for optional parameters & valida­tion
 

Functions

$.is­Arr­ay(­arr­ay) => returns true if array
$.is­Fun­cti­on(­fun­cti­on) => return true if function
$.is­Emp­tyO­bje­ct(­obj­ect) => return true is simple, empty object
$.is­Pla­inO­bje­ct(­obj­ect) => return true if object was created with {} or 'new' keyword
$.is­Xml­Doc­(doc) => return true if xml document or node within xml document*
$.is­Num­eri­c(n­umb­er) => return true if number
$.is­Win­dow­(wi­ndow) return true if window or frame
$.ty­pe(­obj­ect) => returns type of object as string
 

type() Function Return Values

Download the jQuery Utility Functions: Type Testing Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/dan-schmidt_jquery-utility-functions-type-testing.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Web Programming Cheat Sheet
          jQuery Cheat Sheet
          Dojo 1.8 Cheat Sheet