function print_hi(foo, condition){ while( condition (foo) ){ console.log("Hi!"); foo++; } } print_hi(3, x => x < 10); print_hi(12, x => x%8 != 0); print_hi(25, x => x <= 38);