Are there functional differences between these two ways of declaring a function? : javascript

05/02/2018


Are there functional differences between these two ways of declaring a function? Or is it just a stylistic difference?

var add1 = function(num1, num2) {
return num1 + num2;
}
function add2(num1, num2) {
return num1 + num2;
}

Will add1() and add2() behave in exactly the same way or are there some differences?

قالب وردپرس