How to pass the value 'undefined' to a function with multiple parameters?

Tags: Javascript, apply

function myFunction (parm1, parm2) {

    if(typeof (parm1) === "undefined"){
        alert("parm1 is undefined")
    }

    if(typeof (parm2) === "undefined"){
        alert("parm2 is undefined")
    }

}

var myParameters = [undefined, "abc"];

myFunction.apply(valueForThis, myParameters );

No Comments

Add a Comment