I can't find it anywhere on google an explanation of what the return false can and can't stop

I'm not sure, and I don't have anywhere to confirm, other than trial and error, but I've come to the conclusion that 'return false' statements withing

Code:
function() {
    doSomething()

    function() {
        if (true) return false
        do() // won't get called
    }

    doSomethingAgain() // will get called

    if (true) return false

    doSomethingElse()//won't get called
}
If anyone can give an explanation of why this works. Also, do 'for' statements act the same way as 'if' statements, meaning that if a return false is called within a for loop, will it stop everything in that loop, AND in the function containing the for loop?