Show Menu

jQuery Utility Functions: Type Testing Cheat Sheet by

Overview of jQuery's type testing utility functions.

Use Cases

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


$.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



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