Skip to content

Instantly share code, notes, and snippets.

View Chenzo's full-sized avatar
☠️
Piratey coding.

Vince Suriani Chenzo

☠️
Piratey coding.
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);
}
}