What are functions?
Reusable blocks of code
Write an example of a function declaration
function greetWorld() {
console.log('Hello, World!);
}Write an example of a function expression
const calculateArea = function(width, height) {
const area = width * height;
return area;
};Write an example of an arrow function
const calculateArea = (width, height) => {
const area = width * height;
return area;
};Using arrow notation, write an example of a function with a single-line block of code and multi-line block of code
Single-Line Block const sumNumbers = number => number + number;
Multi-Line Block
const sumNumbers = number => {
const sum = number + number;
return sum;
};