Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if argument is passed

function func(arg1, arg2) {
  if (typeof arg2 === "undefined") {
    arg2 = "defaultValue";
  }
  
  //Rest of function
}
 
PREVIOUS NEXT
Tagged: #javascript #check #argument #passed
ADD COMMENT
Topic
Name
1+4 =