Function Declaration

Start Keyword function

  • 4 elements of functions:
    • function keyword function
    • function identifier (name) add
    • function parameters (inside the () brackets)
    • function body (whats inside the {} brackets)
  • default return value is undefined (if not overwritten)
function add(a,b) {
    console.log("Adding " + a + " and " + b);
    return a+b;
}