lang.mustache revision 7bf968657bff10ad28ae9742176e4e814dbc3849
0N/A<p>`Y.Lang` contains JavaScript language utilities and extensions that are used in the core library.
0N/A<p>Testing for an actual `Array`, this helps fight against false positives from `arguments` and `getElementsBy*` array-like structures.</p>
0N/AY.Lang.isArray([1, 2]);
0N/AY.Lang.isArray({"one": "two"});
0N/A return Y.Lang.isArray(a);
1879N/A<p>Checking for `Objects`, since `new Object()`, '{}', '[]' and `function(){}` are all technically Objects.</p>
1879N/AY.Lang.isObject(function(){});
0N/AY.Lang.isObject([1,2]);
0N/AY.Lang.isObject(true);
0N/AY.Lang.isObject("{}");
0N/A<p>Checking for `Function`, since a `function` is a `function`, but an `Object` is not a function.</p>
0N/AY.Lang.isFunction(function(){}); // true
0N/AY.Lang.isFunction({foo: "bar"}); // false
0N/AY.Lang.isNumber(123.123);
0N/AY.Lang.isNumber("123.123");
0N/AY.Lang.isNumber(1/0);
0N/AY.Lang.isString("{}"); // true
0N/AY.Lang.isString({foo: "bar"}); // false
0N/AY.Lang.isString(123); // false
0N/AY.Lang.isString(true); // false
0N/AY.Lang.isBoolean(false);
0N/AY.Lang.isBoolean("true");
0N/AY.Lang.isNull(null); // true
0N/AY.Lang.isNull(undefined); // false
0N/AY.Lang.isNull(""); // false
0N/AY.Lang.isUndefined(undefined); // true
0N/AY.Lang.isUndefined(false); // false
0N/AY.Lang.isUndefined(null); // false