Cpp While Loop Syntax In Javascript