For example, in which version of node this code is:

const factorial = (n) => { if (n === 1) { return 1; } else { return n * factorial(n-1); } } 

Will not cause a syntax error? And in which it should be replaced by:

 var factorial = function factorial(n) { if (n === 1) { return 1; } else { return n * factorial(n - 1); } }; 

1 answer 1

Arrow functions are supported in Node since version 4.4.5. Const - in general, since some 0.10.h versions in strict mode.

You can learn in Google ( here for example )