Cheatography
https://cheatography.com
Overview of jQuery's type testing utility functions.
Use Cases
Determine the type of an object |
Allow for optional parameters & validation |
|
|
Functions
$.isArray(array) => returns true if array |
$.isFunction(function) => return true if function |
$.isEmptyObject(object) => return true is simple, empty object |
$.isPlainObject(object) => return true if object was created with {} or 'new' keyword |
$.isXmlDoc(doc) => return true if xml document or node within xml document* |
$.isNumeric(number) => return true if number |
$.isWindow(window) return true if window or frame |
$.type(object) => returns type of object as string |
|
|
type() Function Return Values
boolean
|
number |
string |
function |
array |
date |
regexp |
object |
undefined |
null |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets