lazy_load_group.push( { id: 'js-hottpye-bestsale', target: '#js-hottpye-bestsale', loadFn: function () { getProductBestsale(); }, }, ) function lazyCategoryBox(){ for (let i = 0; i <= category_to_fetch.length - 1 && 1<2; i++) { let idCat = category_to_fetch[i] lazy_load_group.push( { id: "js-product-" + idCat, target: "#js-product-" + idCat, loadFn: function () { getCategoryProduct(idCat) }, }, ); } }