Parameters and Arguments

We can make some functions to take input which are treated as arguments. These arguments can be values or variables Arguments are places inside the function name's parenthese

Example:

function area(length, breadth) {
    
    console.log(length * breadth);
}

area(10, 6);

// Output: 60

Another example:

function sayThanks(name) {
  console.log('Thank you for your purchase ' + name + '! We appreciate your business.');
}

sayThanks('Cole');

// Output: Thank you for your purchase Cole! We appreciate your business.

Last updated