Code Error doubt

function count() {
var initial = 1;
function plus() {
console.log(++initial);
}
return plus();
}
var c = count();
c();
c();

When the mentor Mr. Arnav Gupta run the code his output showed up 2 and 3. But when I run the same code in Webstorm, It shows error. Please resolve the issue.

Just change var c=count() to var c=count and it will work

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.