From 9111104f978c9d26aa43b0a792146a4a26928a45 Mon Sep 17 00:00:00 2001 From: Dan Holmes Date: Thu, 3 Dec 2020 15:35:56 +0000 Subject: [PATCH] Switch for loop for foreach --- js-jasmine/src/shop.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js-jasmine/src/shop.js b/js-jasmine/src/shop.js index c21e02f2..1f0550be 100644 --- a/js-jasmine/src/shop.js +++ b/js-jasmine/src/shop.js @@ -5,9 +5,9 @@ class Shop { this.MIN_QUALITY = 0; } updateQuality() { - for (var i = 0; i < this.items.length; i++) { - this._updateItem(this.items[i]); - } + this.items.forEach(item => + this._updateItem(item) + ) return this.items; }