setTimeout (function () {. resolve(posts);. }, 3000);. });. } 這支程式會回傳一個Promise,而模擬在1 秒後resolve 一個模擬的 posts 。
確定! 回上一頁