I have written the code in es6 format and compiled the code using parceljs. It is working fine in Chrome and not working in IE11. I am getting an error:
Object doesn't support property or method 'forEach'
Code written:
function startGame(){
circleTurn = true;
cellElements.forEach(cell=>{
cell.addEventListener('click',handleClick,{once:true});
});
swapTurns();
}
After compilation code by parcel
function startGame() {
circleTurn = true;
cellElements.forEach(function (cell) {
cell.addEventListener('click', handleClick, {
once: true
});
});
swapTurns();
}