.each() is use for looping in jQuery. It is similar to foreach loop in the PHP which loops until it gets data.
It works with an Array, Object, and jQuery selector, and you don’t have the need to know how many data are available it performs iteration continuously until it getting data that makes it differ from other looping methods.
While iteration it also keeps tracking the element index.