how to check if a function has argument js code example
Example: javascript check if argument is passed
function func(arg1, arg2) {
if (typeof arg2 === "undefined") {
arg2 = "defaultValue";
}
//Rest of function
}
function func(arg1, arg2) {
if (typeof arg2 === "undefined") {
arg2 = "defaultValue";
}
//Rest of function
}