3 ms·
Threads are quite useful, and Javascript has them. However, if what you have is a computation you have the inputs to start now and won't need the result of for
by JoshTriplett 13y ago
Threads are quite useful, and Javascript has them. However, if what you have is a computation you have the inputs to start now and won't need the result of for a while, lazy evaluation is a far more natural representation for that than a thread.
Ideally, a language ought to have one representation for lazy evaluation, not a dozen; perhaps at some point a new standard will come out that standardizes some subset of lazy evaluation that has won out. Welcome to Javascript.
- zaphar 13y agoJavascript does not have threads. There are some Javascript environments that may or may not have threads in some form. Rhino, WebWorkers. But Javascript does not have a builtin concept of threads.