Error: Maximum Call stack size exceeded?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function factorialize(num) {
if (num=0){
  return 1;
}
return factorialize(num-1)*num;
}

factorialize(5);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 OPR/77.0.4054.277

Challenge: Factorialize a Number

Link to the challenge:

= is assignment. You are saying "if assign the number 0 to the variable num"

1 Like

yes yes you are right , I shoud have used == .

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.