Reputation: 147
When accessing my website from google chrome everything works fine(also on mobile). but when trying to access from edge \ mobile normal browser(not google chrome) i get
TypeError: Object doesn't support property or method 'flat'
trying to access a function .flat of array.
turns out that it dosent exist on the proto at all. what can i do with it? the childs array is defined as
`let childs = [];`
Upvotes: 10
Views: 11125
Reputation: 1780
IE does not support Array.prototype.flat()
. you can use reduce
and concat
as a workaround:
childs = childs.reduce((acc, val) => acc.concat(val), [])
Upvotes: 26