var point = new Array(); var x = new Array(); var artist = new Array(); var num = new Array(); var delta; function sample() { function doubleUp(value) { return value * 2; } function increment(value) { return value + 1; } function output(value) { alert(value);// => (1 + 1) * 2 } var promise = Promise.resolve(100); promise .then(increment) .then(doubleUp) .then(output) .catch(function(error){ // promise chain中にエラーが発生した場合に呼ばれる console.error(error); }); }