Difference in functions

Hello guys, i was learning the functions in Javascript, but i wondered
What’s the difference between

function getPizza(type, topping) {...}


const getPizza = (type, topping) => {...};

They’re both functions, but i don’t understand the difference…

we have function statements and function declarations, which you can read about here:

the arrow function expression you use (with const was introduced in es6 (which was released in 2015), its a shorter version of the function expression

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.