use array foreach over jquery each