var x=5;
var fx=function(){
console.log("hey");
(function(){
if (x==5){
console.log('hi');
return;
}
})();
console.log('end');
};
fx();
我如何以這樣的方式返回,最終console.log
不執行時x==5
?
我是新來的JavaScript,所以也許我錯過了什麼......
我只是好奇你爲什麼要這個 – JSelser
這只是我編造的一個案例,用來作爲我正在處理的更復雜的代碼的示例,但它遵循類似的模式。 – Academiphile