JavaScript Functions

Named Functions

function davidsFunction() {


}

Anonymous Functions

function() {


}

Functions with arguments

function calcContrast(color1, color2) {
  let contrast;
  /* contrast calculation..... */
  return(contrast);
}

calling a function:

let myContrast = calcContrast('a51c30','ffffff');