Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

JS Basic - What is parameter

0 votes
55 views
added Apr 19 in Javascript by lcjr Second Warrant Officer (3,160 points)
// Basic function with 3 parameters  
function argCheck(parameter1, parameter2, parameter3){
  console.log(parameter1 + parameter2 + parameter3);
}

 

2 Responses

0 votes
responded Apr 19 by lcjr Second Warrant Officer (3,160 points)
//the parameter of the following formatDate function is userDate
function formatDate(userDate) {
  // format from M/D/YYYY to YYYYMMDD
}

 

0 votes
responded Apr 20 by lcjr Second Warrant Officer (3,160 points)
function getRectArea(width, height) {
  if (width > 0 && height > 0) {
    return width * height;
  }
  return 0;
}

console.log(getRectArea(3, 4));
// expected output: 12

console.log(getRectArea(-3, 4));
// expected output: 0

//example from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...