Have any difference var name; name = 1; vs var name = 1;

So there can set values like

var number = 1;

var number;

number = 1;

Have any difference in usage where need to set first and second to work the code?

It really just depends on context. Sometimes you will want a variable to have an initial value. Sometimes Bad Things can happen if a variable is undefined. It’s just a matter of how that variable will be used in the rest of the function.

Still you know something about var names need to set before function or after?

What? Are you trying to ask about global vs local scope?