weakmap 和nodelist的forEach 方法的 Polyfill

weakmap 和nodelist的forEach  方法的 Polyfill

低端机型下, 没有weakMap和 nodelist的forEach方法, 需要自己做Polyfill

 

https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach

if (window.NodeList && !NodeList.prototype.forEach) {
   NodeList.prototype.forEach = Array.prototype.forEach;
}

 

https://github.com/drses/weak-map

import WeakMap from "weak-map"
self.WeakMap = WeakMap;

 

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » weakmap 和nodelist的forEach 方法的 Polyfill