开发者

Skipping arguments in JavaScript

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

    return b;
}

How can I call this function will only the second ar开发者_StackOverflow中文版gument? In other words, I want a to be undefined.


my_func(undefined, b);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜