• + 2 comments

    The return statement stops the execution of the function and returns the value of the return statement, so the way you have written it would only give the value of what is in your first return statement and ignore anything after that.