1๐
โ
You could use spread operator to concatenate the original array with the new one :
this.elements =[...this.elements, ...response.data]
2๐
You can use push
with spread operator:
this.elements.push(...response.data)
E.g.
const arr1 = [1, 2, 3];
const arr2 = [12, 13, 14];
arr1.push(...arr2);
console.log(arr1);
Source:stackexchange.com