Some isType like isArray, isBoolean, isDate, isFunction, isNumber, isObject, isRegExp, isUndefined and isString.
$.isArray([]); // => true
$.isArray('Hello World!'); // => false
$.isBoolean(false); // => true
$.isBoolean('Hello World!'); // => false
$.isDate(new Date()); // => true
$.isDate('Hello World!'); // => false
$.isFunction(function () {}); // => true
$.isFunction('Hello World!'); // => false
$.isNaN(NaN); // => true
$.isNaN(0); // => false
$.isNumber(0); // => true
$.isNumber(NaN); // => false
$.isObject({}); // => true
$.isObject('Hello World!'); // => false
$.isRegExp(/0/); // => true
$.isRegExp('Hello World!'); // => false
$.isString(''); // => true
$.isString([]); // => false
$.isUndefined(undefined); // => true
$.isUndefined('Hello World!'); // => false
var arrayPrototype = Array.prototype;
arrayPrototype.forEach || (arrayPrototype.forEach = function(b, c) {
var a = 0,
i = this.length;
for(a; a < i; a += 1) b.call(c, this[a], a, this)
});
- GitHub: Víctor García
- Twitter: @gcv
Public domain: http://unlicense.org/