📌  相关文章
📜  javascript 检查参数是否通过 - Javascript 代码示例

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

代码示例2
function addition(arg1, arg2) {
            if (typeof arg1 === "undefined" || typeof arg2 === "undefined") {
                arg3 = "Please Give Me Default Value";
                document.write(arg3);
                console.log(arg3);
            } else {
                var arg1;
                var arg2;
                var arg3 = arg1 + arg2;
                document.write(arg3);
                console.log(arg3);
            }
        }