promiseのthenからthen呼び出す
<apex:page>
<html>
<head>
</head>
<body>
<script type="text/javascript">
var p2 = new Promise(function(resolve, reject) {
resolve(1);
});
p2.then(function(value) {
console.log(value); // 1
return value + 1;
}).then(function(value) {
console.log(value + ' - A synchronous value works'); // 2 - A synchronous value works
});
p2.then(function(value) {
console.log(value); // 1
});
</script>
</body>
</html>
</apex:page>
結果