Implementation of CycleDetection.js seems inappropriate.
Weird function name main() and its invocation can cause the program to crash.
Tests are missing.
Not exported, Hence not resuable.
Can be optimized further (Optional)
As I can see, the current implementation of calculating the factorial of a number returns a string like "The factorial of 5 is 120" instead this function must return an integer value of 120, so that we can use this function in other algorithms to calculate factorial without having to write logic...
This file uses Numbers at the matrix algorithm to compute the nth number in the Fibonacci sequence. My reasons to recommend BigInt are these:
BigInts can't use Binet's Formula, nor the rounded and simpler variant because that requires arbitrary-precision floating-point computation