58. Go - Break/Return
Break: break out of a loop, but continue the code below the loop
break is used to immediately terminate a for loop, a while loop or a switch statement. You can not break from an if block.
Return: break out of loop and out of method or whole block {} and return the value to caller.
return is used the terminate a method (and possibly return a value).
Comments
Post a Comment