Some isTypes methods like isArray, isBoolean, isDate, isFunction, isNumber, isObject, isRegExp, isUndefined and isString.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.html
istype.js
istype.min.js

README.md

@)isType._

Some isType like isArray, isBoolean, isDate, isFunction, isNumber, isObject, isRegExp, isUndefined and isString.

Usage

isArray

$.isArray([]); // => true
$.isArray('Hello World!'); // => false

isBoolean

$.isBoolean(false); // => true
$.isBoolean('Hello World!'); // => false

isDate

$.isDate(new Date()); // => true
$.isDate('Hello World!'); // => false

isFunction

$.isFunction(function () {}); // => true
$.isFunction('Hello World!'); // => false

isNaN

$.isNaN(NaN); // => true
$.isNaN(0); // => false

isNumber

$.isNumber(0); // => true
$.isNumber(NaN); // => false

isObject

$.isObject({}); // => true
$.isObject('Hello World!'); // => false

isRegExp

$.isRegExp(/0/); // => true
$.isRegExp('Hello World!'); // => false

isString

$.isString(''); // => true
$.isString([]); // => false

isUndefined

$.isUndefined(undefined); // => true
$.isUndefined('Hello World!'); // => false

lt-ie9

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)
});

Inspiration

Author

License

Public domain: http://unlicense.org/