๐พbaseTypeName()
JS โฉ value โฉ type โฉ name โฉ baseTypeName()
๐พ replit๏ผisClass()
๐ compare๏ผ typeName()
(to use it, copy and paste from ๐ module file๏ผ typeName())
// โญ base type name
function baseTypeName(value) {
// --------------
// โ โฑ -1 (index of last character)
// 0123456789012
// โญโโโฎ
// "[object XXXX]" โญโโโโฎ
// ^^^^ <---- slice(8, -1)
return Object.prototype.toString.call(value).slice(8, -1);
}
Last updated
Was this helpful?