var that = this;
that.hello().then(res => { return that.world(res);
}).then(res => { console.log(res); }) function hello(){ var that = this; var p = new Promise((resolve,reject) => { resolve('hello '); }) return p; } function world(params){ var that = this; var p = new Promise((resolve, reject) => { resolve(`${params}world!`); }) return p; }