My issue is that I am receiving an "undefined" error when trying to access the array length. However, everything works fine when I try to access only the array itself.
The following does not work ->
console.log(this.ref_number_response[0].info.length);
This works ->
console.log(this.ref_number_response);
And here is the complete code:
check_ref_number: function () {
this.ref_number_response = [];
axios.get('/is_referenceNumber_free/'+this.ref_number)
.then(response => this.ref_number_response.push({
info: response.data
}));
console.log(this.ref_number_response[0].info.length);
Event.$emit('reference_added', this.ref_number_response);
},