function synchronize (items, cb) {
  return items.reduce(function (promise, item) {
    return promise.then(function () {
      return cb.call(this, item)
    })
  }, RSVP.resolve())
}
/**
 * For each item in the array, call the callback, passing the item as the argument.
 * However, only call the next callback after the promise returned by the previous
 * one has resolved.
 *
 * @param {*[]} items the elements to iterate over
 * @param {Function} cb called for each item, with the item as the parameter. Should return a promise
 * @return {Promise}
 */
For each item in the array, call the callback, passing the item as the argument.
However, only call the next callback after the promise returned by the previous
one has resolved.

@param {*[]} items the elements to iterate over
@param {Function} cb called for each item, with the item as the parameter. Should return a promise
@return {Promise}
For each item in the array call the callback passing the item as the argument . However only call the next callback after the promise returned by the previous one has resolved . @param { * [] } items the elements to iterate over @param { Function } cb called for each item with the item as the parameter . Should return a promise @return { Promise }
function synchronize (items, cb) {
  return items.reduce(function (promise, item) {
    return promise.then(function () {
      return cb.call(this, item)
    })
  }, RSVP.resolve())
}
function synchronize ( items , cb ) { return items . reduce ( function ( promise , item ) { return promise . then ( function ( ) { return cb . call ( this , item ) } ) } , RSVP . resolve ( ) ) }
For each item in the array, call the callback, passing the item as the argument.
For each item in the array call the callback passing the item as the argument .