Once you override the variable
where the function lives, it's over.
If you assign them to a constant, you don't run the risk of overriding them. In general, it's a good idea to always use the keyword const if you want to store your function expressions.
Generally I favour expressions over declarations because they are shorter to type. When written as callbacks, they also seen clearer to me.
If you assign them to a constant, you don't run the risk of overriding them. In general, it's a good idea to always use the keyword
const
if you want to store your function expressions.Generally I favour expressions over declarations because they are shorter to type. When written as callbacks, they also seen clearer to me.
Interesting! You're right! I forgot about const. That's a good one! Thanks for the advice.