it\'s not work if php code after return statement, it\'s confused me. what kind of situation we will write down the code after return statement?
function bar() {
Any time you call return your script returns to it's caller so nothing after a return will ever be ran.
return
If you want the two console.log to be ran put them above the return.
console.log