Like a function which might return some data in some globals.
Globals??????? Regular useage????? AHHHHHHHH!!!!!!!!!!! There's a return keyword for a reason ;) Because it's standard to do that, and it makes the code easier to read.
It's standard practice to declare variables as close as possible to the scope in which they are first needed. Declaring all required variables at the start of a function might seem neat or organised for a small function, but for a non-trivial function it makes code harder to read and maintain.