Answer the question
In order to leave comments, you need to log in
Why doesn't includes and indexOf work when passing a parameter?
methods: {
togglePlatform () {
this.findId(7,[1,2])
},
findId(val, arr) {
console.log(arr) // [1, 2, __ob__: Observer]
console.log(arr.includes(val)) // [Vue warn]: Error in render: "TypeError: newArr.indexOf is not a function"
}
}
// JSON.parse(JSON.stringify(clone)) - эта штука тоже не спасает хоть и уберает обсервер
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question