Hello Everyone, Today, we’re going to print fibonacci series text’s in browser.
Let’s check first fibonacci series alrorithm –
It’s very simple –
Work with Javascript for this Fibonacci Series:
function fibonacci(n) {
let fib = [];
for (let i = 0; i < n; i++) {
fib.push(i < 2 ? i : fib[i - 1] + fib[i - 2]);
}