Nested Promises
问题 I have a function that does a series of asynchronous actions that in turn execute loops of other asynchronous actions. I'd like to know when everything is complete. It seemed like a great time to get my head wrapped around promises. My code in the before-promise state boils down to something like this (hopefully in the simplification process I haven't rendered the example useless): myClass.prototype.doMaintenance = function() { var types = ['choreType1', 'choreType2']; types.forEach(function