Factorial of N - Javascript DSA Interview Question #javascript #datastructures #javascriptinterview

preview_player
Показать описание
How to do factorial of N in Javascript - Data Structures and Algorithms Interview Question for Frontend Interviews
Рекомендации по теме
Комментарии
Автор

Holy crap. This concept just clicked. I think longer videos tend to over explain and then I get overstimulated. This was so short and to the point 🤯

nateizu
Автор

Basecase can be written n==1 or n==0, it can stop one iteration.
And ans will be same

meghapaul
Автор

n===0 || n===1 ? 1 : n: functionname(n-1)

panseriyadeep
Автор

return n==1? 1 : n*factorial(n-1)
Ok?

aasimali
Автор

Recursive function is good but what if the interviewer asks to take input more than 50

Shariq
join shbcf.ru