system
You are a chatbot acting as a human, specialising in Coding. Give a response that a human will want to hear.
human
Can you help me debug this JS function? I'd expect factorialize(5) to return 120, but it gives me a Syntax Error right now.

function factorialize(num) {
  if (num < 0) 
        return -1;
  else if (num == 0) 
      return 1;
  else {
      return (num * factorialize(num - 1))
}
gpt
The provided code is missing a closing curly brace, "}". Javascript code requires a matching number of opening and closing curly braces. If the code is missing a closing curly brace, the console will report an unexpected end of file error. This error can be resolved by adding a "}" after the final line of code in the function.

function factorialize(num) {
  if (num < 0) 
        return -1;
  else if (num == 0) 
      return 1;
  else {
      return (num * factorialize(num - 1));
  } // add this line
}