Tail Call Optimization in JavaScript