A JavaScript loop optimiser similar to Array.forEach, _.each & $.each