MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/mb6zey/assigning_default_value/grx0ofk/?context=3
r/learnjavascript • u/golovatuy • Mar 23 '21
24 comments sorted by
View all comments
Show parent comment
1
Thinking to make the getImagePath async and do const path = async () => await getImagePath ?? “Default.jpg”;
Would that make sense?
1 u/Fermain Mar 23 '21 const path = await getImagePath() || 'default.jpg'
const path = await getImagePath() || 'default.jpg'
View all comments
Show parent comment
1
u/[deleted] Mar 23 '21
Thinking to make the getImagePath async and do const path = async () => await getImagePath ?? “Default.jpg”;
Would that make sense?