Question about functions

I am new to learning JS and Phaser. I have been trying to learn by using the phaser tutorials. I have noticed that in some of them, they create function like

function Name_of_function() 

But sometimes it is like

Name_of_function = function()

Is there a difference between these, if so what is it, and when should I use each one?

:wave:

They’re nearly identical. The first is a function declaration and the second is an unnamed function expression assigned to a variable. For the second one you should use

const Name_of_function = function() {}

For most purposes you could use either.