var average = function (a, b) {
  return (a + b) / 2;
};

console.log(average(2, 2));

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.