If the passed vector size to fft function has length 0. This runs into an infinite loop and gives an error.
RangeError: Maximum call stack size exceeded error
at var X_evens = fft(vector.filter(even)), in fft.js
It is better to add a condition to check this
if (N == 1) {
if (Array.isArray(vector[0])) //If input vector contains complex numbers
return [[vector[0][0], vector[0][1]]];
else
return [[vector[0], 0]];
} ** else If (N <1) //throw or return error**