Yes, you can use return instead of break … break is optional and is used to prevent “falling” through all the other case statements. So return can be used in a similar fashion, as return ends the function execution.
Yes, you can use return instead of break … break is optional and is used to prevent “falling” through all the other case statements. So return can be used in a similar fashion, as return ends the function execution.