or   Register or Register today to make and share your own cheat sheets! (Why Join?)

Cheatography Login

Join Us!

Not a Cheatographer? Register here!

Social Media

You can login to or register with Cheatography using your Facebook or Twitter account!

Why Join Cheatography?

Make and share cheat sheets!
Join a great community of Cheatographers and add your very own contributions.

Save your favourites!
Quick access to your most loved cheat sheets.

Fewer ads!
Members see no ads on the site.

Coming soon ...
Requests, ratings and more!

Why Join Cheatography?

Make and share cheat sheets!
Join a great community of Cheatographers and add your very own contributions.

Save your favourites!
Quick access to your most loved cheat sheets.

Fewer ads!
Members see no ads on the site.

Coming soon ...
Requests, ratings and more!

jQuery Utility Functions: Type Testing Cheat Sheet by dan_schmidt

Comments   |   Add a Comment   |   PDF Download   |   Find:

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

Favourited by 7 Members:

mishin adrienne Rober1992 sebbu cpettit42 webdevo Dranzz

Comments

No comments yet. Add yours below!

Add a Comment

Comment:

Contents

Overview of jQuery's type testing utility functions.

Column Content Comments Author Updated
- jQuery Utility Functions: Type Testing Cheat Sheet dan_schmidt 25 May 12
1 Use Cases 0 dan_schmidt 25 May 12
2 Functions 0 dan_schmidt 25 May 12
3 type() Function Return Values 0 dan_schmidt 25 May 12