Yahoo! recommends YUI 3. Learn about YUI 3 on YUILibrary.com.
The Yahoo Global Object includes several useful type-checking methods in the YAHOO.lang object. Click the Check button in each row to evaluate the data.
| Data | isObject | isArray | isFunction |
|---|---|---|---|
null |
|||
[] or new Array() |
|||
{} or new Object() |
|||
function Foo() {} |
|||
new Foo() |
|||
elem.getElementsByTagName('p') |
|||
YAHOO.util.Dom.
getElementsByClassName( |
|||
YAHOO.lang comes bundled with the YAHOO Global Object.
YAHOO.lang available.
In this example, we use a few of the type-checking methods available in YAHOO.lang to test various types of data.
YAHOO.lang currently supports the following type checking methods:
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.

Copyright © 2013 Yahoo! Inc. All rights reserved.