promise.js When function swap data for whenData in resolve