Enter JavaScript code below, then click Parse. To execute, either click Step repeatedly, or click Run once. Open your browser's console for errors.
const result = []; const fibonacci = function(n, output) { let a = 1, b = 1, sum; for (let i = 0; i < n; i++) { output.push(a); console.log(a); sum = a + b; a = b; b = sum; } } fibonacci(16, result); alert(result.join(', ')); Parse Step Run
Read the JS-Interpreter documentation.
Get the source code.