Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isString(target) {
- return isType(target, 'String')
- }
- function isNumber(target) {
- return isType(target, 'Number')
- }
- function isDate(target) {
- return isType(target, 'Date')
- }
- function isFunction(target) {
- return isType(target, 'Function')
- }
- function isObject(target) {
- return isType(target, 'Object')
- }
- function isArray(target) {
- return isType(target, 'Array')
- }
- function isType(target, type) {
- return Object.prototype.toString.call(target) === `[object ${type}]` ? true : false
- }
Add Comment
Please, Sign In to add comment