You're loop is running the same logic over and over. It will always be the condition of the last loop.   You probably need to use a for loop with something like break or continue. See how I do it here.   See the Pen ae04f1f23935e7d7a13c823d6141dec2 by osublake (@osublake) on CodePen        
    • Like
    6