Function styles


#1

Does anyone know why code academy is teaching the function style as
var myFunction = function(p1,p2){
}

Rather than the wc3 style guide which shows a different declaration style?

function myFunction(p1, p2) {
}


#2

It's whatever convention you prefer, it's not much difference.


#3

It might be because a lot of people here are beginners. In an earlier section they distinguish between declaring variables, local, and global variables. Calling a function like the one above is a bit confusing plus the codecademy way looks neater.