mardi 10 novembre 2020

Confusion about returning in if and else statements [closed]

I cannot think or recall of a specific example, which does not help with my question right not unfortunately. Sometimes, I can end my method that has only an if and else statement and return the result in the if condition and else clause. However, there are sometimes instances, where I must return in the if condition, else clause, and then have to return something outside if and else block to make sure I am not getting a syntax error and be able to use the function/method. Why is it like that? I hope I was clear.

Aucun commentaire:

Enregistrer un commentaire