Pass several arguments and use the returned value.

Parameters and Return

params_return.js
function rectangle(width, height) {
  return width * height;
}

const w = ;
const h = 3;
const area = rectangle(w, h);

console.log("area=" + area);
console.log("doubled=" + (area * 2));
function rectangle(width, height) {
  return width * height;
}

const w = ;
const h = 3;
const area = rectangle(w, h);

console.log("area=" + area);
console.log("doubled=" + (area * 2));
function rectangle(width, height) {
  return width * height;
}

const w = ;
const h = 3;
const area = rectangle(w, h);

console.log("area=" + area);
console.log("doubled=" + (area * 2));
params-return A function can take several parameters and return one value. The returned value is just a number here, so it can feed into more expressions.