Functions

  • Functions let us group and name a series of operations
  • Functions take parameters and return a result
  • Functions can be called elsewhere in your code
  • You can call your function like myFunction(param1, param2)
function sayHello() {
    console.log("Hello");
}

function doMath(a, b) {
    return a + b;
}

function printMath(a,b) {
    console.log(doMath(a,b))
}

10 / 24