From b9d4ec4c5c3e501738fdfdb07c95f86506d535ad Mon Sep 17 00:00:00 2001 From: Dan Head Date: Sat, 12 Jan 2019 21:11:01 +0000 Subject: [PATCH] Convert NodeList to Array to use forEach in older browsers --- js/windy.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/windy.js b/js/windy.js index f48c9ad..f86557c 100644 --- a/js/windy.js +++ b/js/windy.js @@ -8,11 +8,12 @@ const windy = { }; export default function init() { - document.querySelectorAll('img').forEach((image) => { - const img = new Image(image); - img.start(); - windy.images.push(img); - }); + Array.prototype.slice.call(document.querySelectorAll('img')) + .forEach((image) => { + const img = new Image(image); + img.start(); + windy.images.push(img); + }); windy.menu = new Menu({ container: document.querySelector('.menu'), });