Do variables need to be declared if they're being used in a function?

Not sure if I answered your question in the other thread.

I’d suggest giving this a good read.
You Don’t Know JS Yet: Scope & Closures - 2nd Edition