r/JavaScriptTips • u/No-Upstairs-2813 • Nov 08 '22
Difference between Function Declaration and Function Expression
We are already familiar with two ways of defining functions:
function greet() {}and
const greet = function() {}But how are they different and when to use one over the other? Most developers aren’t sure on using which one and often tend to use the wrong one. Check out the post to find out these answers.
13
Upvotes
1
u/Basediver210 Nov 09 '22
Thanks. Im coming from other programming languages, and the difference doesn't seem to stick for me. This helped