I'm extending builtIn Array with my class MyArray When i try to store MyArr to Vuex, I loose instance, and get bultIn Array
What's wrong?
class MyArray extends Array{/*some methods*/}
const state = {
arr: new ModuleOperationArray(),
}
const mutations = {
setArr: (state) => {
console.log(state.arr instanceof MyArray); //false -- WHY?
let arr = new MyArray();
console.log(arr instanceof MyArray); //true -- expectedly
state.arr = arr;
console.log(state.arr instanceof MyArray); //false -- WHY?
}
}