Skip to content

Instantly share code, notes, and snippets.

View dreambo8563's full-sized avatar
🎯
Focusing

Vincent Guo dreambo8563

🎯
Focusing
View GitHub Profile
@dbayarchyk
dbayarchyk / promiseCatchWithAwait.js
Created October 1, 2019 13:14
Async/await without try/catch in JavaScript
async function fetchAndUpdatePosts() {
const posts = await fetchPosts().catch(() => {
console.log('error in fetching posts');
});
if (posts) {
doSomethingWithPosts(posts);
}
}