gpt4 book ai didi

javascript - if..else 与 if(){return}

转载 作者:数据小太阳 更新时间:2023-10-29 03:50:11 26 4
gpt4 key购买 nike

<分区>

在下面的示例中 - 假设返回值并不重要 - 是否有理由优先选择其中一种方法?

// Method 1
function (a, b) {
if (a == b){
// I'm just interested in
// the stuff happening here
} else {
// or here
}
return true;
}

// Method 2
function (a, b) {
if (a == b){
// I'm just interested in
// the stuff happening here
return true;
}
// or here
return true;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com