function getType elem return toString call elem slice -1 function log

1
2
3
4
5
6
7
function getType(elem) {
return {}.toString.call(elem).slice(8, -1);
}
function log(str) {
console.log(str);
}