typeof variable;
typeof variable;
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"
typeof operando
function gettype(data) {
let itemType = Object.prototype.toString.call(data)
let type = ''
switch (itemType) {
case "[object Null]":
type = 'Null';
break;
case "[object Object]":
type = 'Object';
break;
case "[object Array]":
type = 'Array';
break;
case "[object String]":
type = 'String';
break;
case "[object Boolean]":
type = 'Boolean';
break;
case "[object Number]":
type = 'Number';
break;
}
return type
}
Object.prototype.toString.call(data)