JavaScript interview question | Generators, While & for, Fibonacci | JavaScript Simplified #Shorts

preview_player
Показать описание
This is a medium level JavaScript question which check your knowledge of generators, While & for loop, Fibonacci series. Try to solve this in 10 sec. Write your answer in comment section, I will add right answer soon.
Рекомендации по теме
Комментарии
Автор

0, 1, 1, 2, 3, 5, 8, 13, 21 and after this it will break because of for loop.
So basically purana number se new number ka addition . And “p” here is acting as a temporary store .
And the trick here is the generator function

DevanshSadhotra
welcome to shbcf.ru