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
- Host: GitHub
- URL: https://github.com/devongovett/is.js
- Owner: devongovett
- Created: 2010-07-18T23:40:51.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2010-07-18T23:44:05.000Z (almost 16 years ago)
- Last Synced: 2025-02-10T14:53:31.921Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 85.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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