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

后端 未结 1 1149
被撕碎了的回忆
被撕碎了的回忆 2021-01-29 17:15

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() {         


        
1条回答
  •  再見小時候
    2021-01-29 17:25

    Any time you call return your script returns to it's caller so nothing after a return will ever be ran.

    If you want the two console.log to be ran put them above the return.

    0 讨论(0)
提交回复
热议问题