而使用ES 6规范Promise中可以这样处理展开实例返回的结果数组。
Promise.delay(500).then(function() {
return [fs.readFileAsync("file1.txt"),
fs.readFileAsync("file2.txt")] ;
}).all().then(function([file1text, file2text]) {
if (file1text !== file2text) {
console.log("files are equal");
} else {
console.log("files are not equal");
}
});