I have this code:
var labelsPrint= new Array();
var vector = labelsPrint.map((el) => el.id);
IE11 give me a error, because lost the datas. Do you know an other way for make this .map?
In order to free up resources to deliver customer-requested features available to modern browsers, Google Maps Platform is ending support for Internet Explorer 11. Microsoft ended support for IE11 in 2021 and encouraged migration to Microsoft Edge.
map() can be used to iterate through objects in an array and, in a similar fashion to traditional arrays, modify the content of each individual object and return a new array. This modification is done based on what is returned in the callback function.
JavaScript | Array map() Method The map() method in JavaScript creates an array by calling a specific function on each element present in the parent array. It is a non-mutating method. Generally map() method is used to iterate over an array and calling function on every element of array.
Array.prototype.map() The map() method creates a new array populated with the results of calling a provided function on every element in the calling array.
IE11 has ES5, not ES6
var vector = labelsPrint.map(function (el) { return el.id; });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With