what is wrong with this loop
Initial value of b
fails this check.
2*b+1 < 5
So neither loop body, nor the increment are ever executed.
consider
2*b +1
as2*c +1
, i just ask, is this condition is a valid loop condition
Yes, you can put any valid javascript expression there. As long as it parses, it’s good.
solved why can we use proper javascript condition inside for loop standard condition [closed]