Nested While Loop Javascript Break Syntax