const isType=function(type){
return function(obj){
return Object.prototype.toString.call(obj)===`[object ${type}]`;
}
}
const isString=isType('String');
const isArray=isType('Array');
const isNumber=isType('Number');
isString('s'); //true
isArray([1,2]); //true
isNumber(1); //true