---
description: check if value is an object
---

# isObject()

[JS](../../..) ⟩ [values](../..) ⟩ [custom functions]() ⟩ isObject()

{% hint style="success" %}
check if [..](../.. "mention") is an [obj](../../obj "mention").
{% endhint %}

{% tabs %}
{% tab title="💾 程式" %}
* replit：[isPrimitive()](https://replit.com/@pegasusroe/isPrimitivevalue#isPrimitive.js)

```javascript
// ⭐ 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 };
```
{% endtab %}

{% tab title="👥 相關" %}
* [isprimitive](isprimitive "mention")
* [isnumber](../../prim/num/number+ext/isnumber "mention")
* [nan](../../prim/num/special/nan "mention")
{% endtab %}

{% tab title="📘 手冊" %}
* [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
{% endtab %}
{% endtabs %}
