what it's mean that code after return statement in javascript? -


it's not work if php code after return statement, it's confused me. kind of situation write down code after return statement?

function bar() {     console.log('1', foo)     foo = 10;     console.log('2', foo)     return;     console.log('3', foo)     function foo() {}     console.log('4', foo) } 

, these

console.log('3', foo) console.log('4', foo)  

are not work.

only function declarations (hoisted)?

any time call return script returns it's caller nothing after return ever ran.

if want 2 console.log ran put them above return.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -