How can I make or simulate a javascript class that extends another class and Array. I have another class Serializable
that it also needs to extend to have a serialize
and deserialize
function.
class ArrayLikeClass extends Serializable({"_title": "raw"}){
constructor(title){
this._title = title;
}
/* Serializable adds these:
serialize(){...serializes the class}
static deserialize(){...deserializes the class}
// I don't want to add these in manually */
}
Using this I have a class that is serializable. How can I make this have the methods serialize
and deserialize
from Serializable but also extend Array
I would use mixins as suggested in the possible duplicate, however how can I use mixins to have a static function deserialize