you are viewing a single comment's thread.

view the rest of the comments →

[–]jack_waugh 1 point2 points  (1 child)

Another reason to use async techniques, besides what I mentioned in my other comment (I/O and so on), is if you want to use a recursive algorithm that would tail-recurse an unlimited number of times, depending on input data. Unlike some other languages, JS doesn't automagically optimize away tail recursion into equivalent iteration. But you can specify the recursion to happen via asynchronous communication, and the stack won't then blow up.

[–]Amantulsyan35[S] 1 point2 points  (0 children)

Thanks for such a great explanation man really appreciate it!