# cannot assign to read only property 'prototype' of function 'xxx'❗️

[JS](../..) ⟩ [error](..) ⟩ [TypeError]() ⟩ cannot assign to read-only property 'prototype' of function 'xxx':exclamation:

{% hint style="danger" %}
[<mark style="color:red;">**TypeError**</mark>]()：[<mark style="color:yellow;">**cannot assign to read-only property '**</mark><mark style="color:orange;">**prototype**</mark><mark style="color:yellow;">**' of function 'xxx'**</mark>](cant-assign-readonly):exclamation:
{% endhint %}

{% tabs %}
{% tab title="💈範例" %}
```javascript
class A {}

A.prototype = {};    // ⛔ TypeError
//          ^^^^
// ⛔ TypeError: 
// Cannot assign to read only property 'prototype' of function 'class A {}'
```
{% endtab %}

{% tab title="👥 相關" %}
* a [**class**](../../val/class)'s [<mark style="color:yellow;">**prototype**</mark>](../../val/func/prototype) (property) is <mark style="color:red;">**read-only**</mark>:exclamation:
{% endtab %}
{% endtabs %}
