DEV Community

Discussion on: Traditional Functions or Arrow Functions in Javascript?

Collapse
 
savagepixie profile image
SavagePixie • Edited

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.

Collapse
 
jharteaga profile image
Jose Arteaga

Interesting! You're right! I forgot about const. That's a good one! Thanks for the advice.