Medium javascript

Fibonacci series (first 10 terms)

Problem

Print the first 10 Fibonacci numbers starting with 0 and 1.

Hints
  • Keep two variables and update them each iteration.

Your practice code

Ready — edit the code above and click Run.

Solution

// See explanation
console.log("done");

Try solving on your own first, then reveal the official answer.

Explanation

Each term is sum of previous two. Interviewers often ask iterative vs recursive versions.

Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details