Skip to content Skip to sidebar Skip to footer

Fibonacci Calculator Steps

Everything work but I have a question on this Fibonacci calculator (see in-code comment). Could I skip the console.debug step? Why is it needed? var getFibSum = document.getElement

Solution 1:

Number.MAX_VALUE is the maximum value your system can address and that part of code actually stops the script and outputs the last numbers in case you go over that max value.

Since you're doing only 50 iterations, it's highly unlikely you'll even come close to that number, so you can freely remove the whole if-clause if it bothers you.

Solution 2:

console.debug just prints some debug information, it can be removed safely.

Post a Comment for "Fibonacci Calculator Steps"