Is there such a concept as a synchronous promise? Would there be any benefit to writing synchronous code using the syntax of promises?try {  foo();  bar(a, b);  bam();} catch(e) {  handleError(e);}...could be written something like (but using a synchronous version of then);foo()  .then(bar.bind(a, b))  .then(bam)  .fail(handleError)
Would there be any benefit to writing synchronous code using the syntax of promises
javascript
Absolutely!  For several reasons:Promises provide an excellent error checking system.  You can return a promise and let the caller deal with the promise however he or she wishes (or not at all).  Many would argue that promises make your code cleaner and easier to read, which is no small thing.  I would argue that promises are worth using if for no other reason than the fact that it is elegant.  Last, but certainly not least, your implementation now is synchronous but should that ever change, you don't have to change a big section of code in order to make synchronous work asynchronously, but just the actual implementation.  Now, please don't get me wrong, I don't think you should use promises for every thing you do in the program, though for something that is even mildly cpu-intensive or complicated, I would get into the habit of using promises to implement these operations. The main drawback is that promises are not fully supported in older browsers, so if you decide to go this route, consider using some polyfill library like bluebird or q to make it work both in newer browsers as well as older browsers.Hope that helps!