IE에서 forEach 함수 사용 불가

지니씨·2021년 8월 19일
0

프론트엔드

목록 보기
8/84
if ('NodeList' in window && !NodeList.prototype.forEach) {
  console.info('polyfill for IE11');
  NodeList.prototype.forEach = function (callback, thisArg) {
    thisArg = thisArg || window;
    for (var i = 0; i < this.length; i++) {
      callback.call(thisArg, this[i], i, this);
    }
  };
}
profile
하루 모아 평생 🧚🏻

0개의 댓글