Quick question about return or simmilar statements like console.log etc

Im currently practicing some basics again just for fun, i havent had much chanse to code since i work seasonal job for 12 hours a day. So my question is, with code like this:

function myFunction(num1, num2) {
    if (num1 === num2) {
        return "cool";
    } else {
        return "false";
    return "Fail";
myFunction(20, 10);

return “Fail” will only return Fail message when if statement doesnt make it which means not returning eighter “cool” or “false”. Am i correct?

This function will never return “Fail”. If num1 is equal to num2, it will return “cool”. Those aren’t equal, it will return “false”.

Well, with the code you have right now, the “Fail” return will never be reached.

As soon as you hit a return statement, you are exited out of the closest (loosely used) function.