+ 1

what is the different between break and return?

30th Sep 2016, 3:09 AM
Henry
Henry - avatar
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
30th Sep 2016, 8:12 AM
Andrew Williams
Andrew Williams - avatar