Javascript While Loop Syntax In Js