My code is done in angular.js and I am trying to add several elements to the array. something like that:
$scope.my_array=[];
$scope.my_array.push({"element":1});
var data= {"element":2},{"element":3}
$scope.my_array.push(...data);
console.log($scope.my_array) => [{"element":1},{"element":2},{"element":3}]
I am developing in ionic, and in modern cell phones it works. but in cell phones with versions of 4.4 it does not work and this error appears.
"Uncaught SyntaxError: Unexpected token ."
What alternative can I do using good practice?