Answer the question
In order to leave comments, you need to log in
Why does a variable become a reference to an object after being assigned?
I am writing a vue.js + laravel application.
My method of receiving and processing data
getTestimonials() {
axios.get('/api/testimonials?page='+this.pagination.current_page)
.then(res => {
var response = res.data;
this.testimonials = response;
console.log(res.data.data);
console.log(response.data);
console.log(this.testimonials.data);
this.testimonials.data = [];
console.log(res.data.data);
console.log(response.data);
console.log(this.testimonials.data);
... in the next code i want to use res.data.data but one is emprty
})
.catch((error) => console.log(error));
},
Answer the question
In order to leave comments, you need to log in
Can I zero out the testimonials.data array and use res.data.data further?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question