1 min readNov 20, 2019
Inside the callback function , for each item of array , there is an pop
operation happening
In callback
when the item = 1 โ inside callback there is pop operation โ which will delete the arrays last item โ now the array becomes โ [1,2,0]
when the item = 2 โ inside callback there is pop operation โ which will delete the arrays last item โ now the array becomes โ [1,2]
If the elements of array are removed during the every
function the removed items are not visited .