79375137

Date: 2025-01-21 16:19:19
Score: 2
Natty:
Report link

A return statement just stops the execution of its respective method immediately and returns the value it was assigned. So yes the first example would work just fine

NOTE: the second example is more readable than the first one because only one return statement is being used.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: JohaanThejus