Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

defoult function atributes

function multiply(a, b = 1) {
  return a * b;
}

console.log(multiply(5, 2));
// expected output: 10

console.log(multiply(5));
// expected output: 5
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #defoult #function #atributes
ADD COMMENT
Topic
Name
7+9 =