1. function type (obj) {
    2. return Object.prototype.toString.call(obj).replace(/\[object\s|\]/g,'');
    3. }
    4. console.log(type([])) //"Array"
    5. console.log(type(1)) //"Number"