๐พisObject()
check if value is an object
JS โฉ values โฉ custom functions โฉ isObject()
replit๏ผisPrimitive()
// โญ check if value is object
function isObject(value) {
return value === Object(value)
}
// โญ check if value is primitive
function isPrimitive(value) {
return !isObject(value)
}
// export
module.exports = { isObject, isPrimitive };Last updated
Was this helpful?