Show Menu
Cheatography

jQuery Utility Functions: Type Testing Cheat Sheet by

Overview of jQuery's type testing utility functions.

Use Cases

Determine the type of an object
Allow for optional parameters & validation
 

Functions

$.isAr­ray­(array) => returns true if array
$.isFu­nct­ion­(fu­nction) => return true if function
$.isEm­pty­Obj­ect­(ob­ject) => return true is simple, empty object
$.isPl­ain­Obj­ect­(ob­ject) => return true if object was created with {} or 'new' keyword
$.isXm­lDo­c(doc) => return true if xml document or node within xml document*
$.isNu­mer­ic(­number) => return true if number
$.isWi­ndo­w(w­indow) return true if window or frame
$.type­(ob­ject) => returns type of object as string
 

type() Function Return Values

 

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