ES6: The features I'm most excited about
I've just been playing with Promises and like them a lot.  But one thing I find strange is that ".then()" creates a new promise, but with no way to reject it.<p>ie. I can't write:<p><pre><code>  return new Promise((resolve, reject) => {
    // Do some stuff, call resolve()/reject() on success/failure.
  }).then((step1Val, resolve, reject) => {
    // Do some stuff, call resolve()/reject() on success/failure.
    // But this doesn't actually work, because the "then" callback
    // doesn't get resolve/reject as args.
  });
</code></pre>
Instead I'm having to write this as the following, which is more verbose:<p><pre><code>  return new Promise((resolve, reject) => {
    // Do some stuff, call resolve()/reject() on success/failure.
  }).then(new Promise((resolve, reject) = {
    // Do some stuff, call resolve()/reject() on success/failure.
    // But this way I don't get access to step1Val.
  }));
</code></pre>
Another bummer of this style is that that the second step doesn't get access to the first step's value.