Javascript

Javascript - 피보나치 수열

HiroDaegu 2021. 8. 9. 12:02
728x90
SMALL
let current = 1;
let previous = 0;

for(let i =1 ; i <= 50; i++){  // 50개의 항을 구하는 반복문
  console.log(current);
  let temp = previous;
  previous = current;
  current = current + temp;
}

 

728x90
LIST