A table is basically a variable that stores multiple values. Basket contains the string (test) values of apple and orange. They then used a for loop. Basically it will run a few lines of code (line 4 - 11 in this case) every time for the index. Because they used in pairs(table name) it used the number of items in the table as the index. So it runs the loop once for every item in the table. It checks if the value it's running the loop in is an apple or an orange. If it equals an apple (if item == "apple") or if it's an orange (elseif item == "orange"). Hope this clears it up.