Tail recursion in NodeJS
问题 So I recently came across case I needed to write code where callback calls itself and so on and wondered about NodeJS and tail-call support, so I found this answer https://stackoverflow.com/a/30369729 saying that yup, it's supported. So I tried it with this simple code: "use strict"; function fac(n){ if(n==1){ console.trace(); return 1; } return n*fac(n-1); } fac(5); Using Node 6.9.2 on Linux x64 and run it as node tailcall.js --harmony --harmony_tailcalls --use-strict and result was: Trace