Factorial

const fact = (n) => n ? n * fact(n - 1) : 1

Euclid's algorithm

Euclid used minus, the modern variant uses modulo.

const gcd = (n, m) => m ? gcd(m, n % m) : n

Exp

The natural exponential function. e is its value at the real number 1.

const exp = (x) => Array(99).fill().reduce(
    (e, _, i) => e + x ** i / fact(i), 0)