An open API service indexing awesome lists of open source software.

https://github.com/devongovett/is.js

JavaScript function that returns whether an object is of any of the given types
https://github.com/devongovett/is.js

Last synced: about 1 year ago
JSON representation

JavaScript function that returns whether an object is of any of the given types

Awesome Lists containing this project

README

          

is.js is a JavaScript function that returns whether an object is of a given type. Pass multiple types to test whether an object is of any of the types.

Originally by Dmitry Baranovskiy
Modified by Devon Govett to support multiple types

Examples:

is("test", "array", "string"); //true
is(123, "number", "string"); //true
is([], "object"); //true
is([], "array"); //true
is(new String("test"), "string"); //true