💾isObject()

check if value is an object

JSvaluescustom functions ⟩ isObject()

check if value is an object.

// ⭐ 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