It doesn't work if we use only if-condition. Why so?
An if block/condition is different from a forever block/loop in the sense that a loop, in general, keeps repeating while some condition is true. A forever loop, in particular, as its name suggests keeps repeating forever.
An if condition is only checked once and executed if it is true or not executed otherwise.