how to execute same piece of code for both if and else

If your common statement same location xxx doesn’t need to be in if-else then put it out of the if-else.
I guess you want this.

     condition fails move it
     execute different condition and move it
same location xxx

Browse More Popular Posts

Leave a Comment