how to use while loop in js code example Example: javascript while loop while(condition) { //whatever }