> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/val/type/type-functions/func-def.md).

# functionDefinition()

[JS](/web/js.md) ⟩ [values](/web/js/val.md) ⟩ [custom functions](/web/js/val/type/type-functions.md) ⟩ functionDefinition()

{% tabs %}
{% tab title="💾 程式" %}

* replit：[isClass()](https://replit.com/@pegasusroe/isClass#typeNames.js)
* (to use it, copy and paste from 📁 module file： [typeName()](/web/js/val/type/name/typename.md))

```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()](/web/js/val/type/type-functions/isclass.md)
{% endtab %}

{% tab title="⬇️ 應用" %}

* [isClass()](/web/js/val/type/type-functions/isclass.md) - check if value is a [class](/web/js/val/class.md).
  {% endtab %}
  {% endtabs %}
