+ 2
What languages besides Javascript have the concept of variable hoisting?
... where variable declarations are moved to the top of the current execution context?
3 Answers
+ 3
I can't verify these claims, but I found the following:
https://developer.rhino3d.com/guides/rhinoscript/vbscript-variable-hoisting/
https://til.hashrocket.com/posts/c0c0dd4ef8-variable-hoisting-in-ruby
https://medium.com/@wolfapple/variable-hoisting-in-ruby-3156313daa01
http://stratus3d.com/blog/2015/03/07/variable-hoisting-in-golang/
I hope this helps! đ
+ 2
Variable hoisting is actually a very bad idea. In bigger code bases it is easy to get a collision, which you probably don't want and adds massive complexity.
0
I don't know of any right now, there are function prototypes in c/c++ though. That sort of functions similarly.