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

JSerrorTypeError ⟩ cannot assign to read-only property 'prototype' of function 'xxx'

class A {}

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

Last updated