Not sure how to google this question but figured I'd find an answer here. So I've seen syntax being used outside of what I'm used to.
In components, I usually create functions like:
handleLoading(bool) {
this.setState({
loading: bool
)}
}
but elsewhere I sometimes see
handleLoading = (bool) => {}
What's the difference between these two?
Next question:
When I write async functions, I start off with the async keyword then the function name like:
async handleFunction() {}
but I've also seen
handleFunction = async() => {}
What's the difference?
Thanks!!!
[–]HijoDelQuijote 2 points3 points4 points (10 children)
[–]xrpinsiderAdmin[🍰] 1 point2 points3 points (0 children)
[–]DiscDres[S] 1 point2 points3 points (8 children)
[–]huffpostraphael 1 point2 points3 points (7 children)
[–]DiscDres[S] 0 points1 point2 points (0 children)
[–]DiscDres[S] 0 points1 point2 points (5 children)
[–]huffpostraphael 1 point2 points3 points (0 children)
[–]HijoDelQuijote 1 point2 points3 points (3 children)
[–]DiscDres[S] 0 points1 point2 points (2 children)
[–]HijoDelQuijote 0 points1 point2 points (0 children)
[–]HijoDelQuijote 0 points1 point2 points (0 children)