# functionDefinition()

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

{% tabs %}
{% tab title="💾 程式" %}
* replit：[isClass()](https://replit.com/@pegasusroe/isClass#typeNames.js)
* (to use it, copy and paste from 📁 module file： [typename](../name/typename "mention"))

```javascript
// ⭐️ content of function definition (string)
function functionDefinition(value) {
    
    // ---------------------------------------------------------------------
    // ⭐️ will throw a TypeError if value is not a function:
    //   ⛔ TypeError: 
    //      Function.prototype.toString requires that 'this' be a Function
    // ---------------------------------------------------------------------
    
    return Function.prototype.toString.call(value);
}
```

💈範例：👉 [isclass](isclass "mention")
{% endtab %}

{% tab title="⬇️ 應用" %}
* [isclass](isclass "mention") - check if value is a [class](../../class "mention").
{% endtab %}
{% endtabs %}
