You need to use .each:
var listItems = $("#productList li");
listItems.each(function(idx, li) {
var product = $(li);
// and the rest of your code
});
This is the correct way to loop through a jQuery selection.
In modern Javascript you can also use a for .. of loop:
var listItems = $("#productList li");
for (let li of listItems) {
let product = $(li);
}
Be aware, however, that older browsers will not support this syntax, and you may well be better off with the jQuery syntax above.