gpt4 book ai didi

javascript - 在 JavaScript 中跳过参数

转载 作者:行者123 更新时间:2023-11-30 23:47:41 33 4
gpt4 key购买 nike

function my_func(a, b){
if(typeof(a) !== 'undefined'){
// do stuff
}

return b;
}

如何仅使用第二个参数调用此函数?换句话说,我希望 a 未定义。

最佳答案

my_func(undefined, b);

关于javascript - 在 JavaScript 中跳过参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2532150/

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