当从google chrome访问我的网站时,一切正常(在移动设备上也是如此)。但是当尝试从edge \ mobile普通浏览器(不是google chrome)访问时,我得到
TypeError: Object doesn't support property or method 'flat'正在尝试访问数组的函数.flat。
事实证明,它根本不存在于原稿上。我能用它来做什么?childs数组定义为
`let childs = [];`(使用react作为前端)

发布于 2018-10-27 22:07:43
IE不支持Array.prototype.flat()。您可以使用reduce和concat作为解决方法:
childs = childs.reduce((acc, val) => acc.concat(val), [])https://stackoverflow.com/questions/53022556
复制相似问题