function fibonacci(n){

let i = 0

let prev = 0 
let next = 1

while(i<n){
  console.log(prev);

  [prev, next] = [next, prev+next]
  i++
  
}

	
}

fibonacci(5)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: