Code Playground
Write and test code in multiple languages
Run
Download
Copy
Clear
// Welcome to JavaScript Playground! // Try editing this code and click Run function fibonacci(n) { if (n <= 1) return n; return fibonacci(n - 1) + fibonacci(n - 2); } // Calculate first 10 Fibonacci numbers for (let i = 0; i < 10; i++) { console.log(`Fibonacci(${i}) = ${fibonacci(i)}`); }
Console output will appear here...