+ 1
what is the different between break and return?
1 Respuesta
+ 2
break is used to end a loop prematurely while return is the keyword used to pass back a return value to the caller of the function. If it used without an argument it simply ends the function and returns to where the code was executing previously