/**
 * Computes the `num`-th term of the fibonacci sequence.
 *
 * The rule:
 *
 *   `n` is the term
 *
 *   n    = 0 1 2 3 4 5 6  (terms)
 *   f(n) = 0 1 1 2 3 5 8  (fibonacci sequence)
 *
 * so...
 *
 *   f(n) = f(n-1) + f(n-2)
 *
 * @param  {Number} term The term of the fibonacci sequence
 * @return {Number}      Returns the `num`-th term in the fibonacci sequence
 */
function getFibonacci(term) {
  return term === 0 || term === 1
         ? term
         : getFibonacci(term - 1) + getFibonacci(term - 2);
}

export default getFibonacci;
