📜  10.4.1.3. return 终止函数执行 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:23.443000             🧑  作者: Mango

代码示例1
/*This console.log statement in this function never executes, since the 
function returns before it is reached.*/

function pastThePointOfReturn() {
   return "I'm done!";
   console.log("This will not be printed");
}

console.log(pastThePointOfReturn());

//I'm done!