Daily Archives: July 14, 2016


New Javascript ForEach iterator

Have to start getting used to some iterator syntax. ┬áHere’s how we USED to do it: for (let color in colors) { let colorObj = {}; colorObj.code = colors[color].colorPrdId; colorObj.name = colors[color].colorName; colorObj.imgSwatch = colors[color].imgSwatch; collection.push(colorObj); } Here’s the new way to code┬áthe same thing: colors.forEach(function (color) { collection.push({ code: […]