I came across a code in which return
is used inside an if-else block. But the if-else block is not inside a function body; and it doesn't throw any error. So what is the use of using return
inside if-else that is not inside a function body? (Specifically for Node.js)
if(true) {
return 'foo';
}
Here is the demo. Thanks in advance!!!
Aucun commentaire:
Enregistrer un commentaire