const checkTypes = {}; ['Array', 'Object', 'String', 'Number', 'Boolean', 'Null', 'Undefined', 'RegExp', 'Function'].forEach(type => { checkTypes[`is${type}`] = function (data) { return Object.prototype.toString.call(data) === `[object ${type}]` } }) export default checkTypes