Im trying to convert the script below to a normal function, but fail to understand how.
The script counts the numbers of instances (model) in a Array (productList.Lockers) and appends it to a target div.
productList.Lockers.forEach(o => $('#' + o.model).siblings('#modelcount').text((i, t) => ( parseInt(t, 10) || 0) + 1 ));
var modelCount = document.getElementById('allcount');
modelCount.innerHTML = productList.Lockers.length;