extend("array")

nth = array:nth
tail = array:tail
reduce = array:reduce
append = array:append
range = array:range

fibonacci = compose(
  tail,
  reduce(
    (acc, i) => append(
      i > 1 ? nth(i, acc) + nth(i - 1, acc) : i,
      acc
    ),
    [0]
  ),
  range(0)
)

slog(
  fibonacci(19)
)


