Local variables within functions (var vs local)


Since cfscript resembles Javascript more and more, I was wondering if the
same principle of var (and let?) could be implemented.
In Javascript, due to hoisting, you define all variables under the function
declaration, which is neat (personal taste, convention). In CFscript, you
can also declare everything above, but you can’t keep it undefined (can
So I ended up varring variables in the middle of the code because then is
when they become important. Varring them at the top with a value null looks
a bit weird.

Also, you can’t do something like
var test,bla, foo=13, bar;
but you need to put a var on each new line.

I have also used the namespace local.

So, when you use local the first time to declare a variable, do I need to
keep using the namespace local every time in the scope?
And, is a ‘local’ variable the same as ‘var’ variable, both local only to
the current scope?

All in all, you guys are doing a great job and I would love to see the
scripting direction go more towards ECMA 2015 if that is possible.