function getType(variable)const numArr = [1,2,3]; getType(numArr); //array
return typeof variable === 'object' ? Object.prototype.toString.call(variable).replace('[object ', '').replace(']', '').toLowerCase() : typeof variable; }
2024-01-01 10:43:16
function getType(variable)const numArr = [1,2,3]; getType(numArr); //array
return typeof variable === 'object' ? Object.prototype.toString.call(variable).replace('[object ', '').replace(']', '').toLowerCase() : typeof variable; }