I am using a "Break" to stop the program but it is showing an error. How can I solve that and stop the program? Thanks
Best Answer
break is used to break a for or while loop. Usereturn instead to end the function. Useerror(some error message) to completely end the program due to an error.
It has, several versions ago. If you want to stop a script outside of a loop, usereturn instead ofbreak. It does the same thing, and won’t throw an error.
Best Answer