[Rails-spinoffs] [OT] Of the good use of var

Alexander Presber aljoscha at weisshuhn.de
Tue Jul 4 15:50:02 GMT 2006


For the scoping issue you might want to read this:

http://www.iamcal.com/publish/articles/js/scoping/

Cheers, Alex

Am 04.07.2006 um 17:44 schrieb Nicolas Terray:

> On 7/4/06, Alexander Presber <aljoscha at weisshuhn.de> wrote:
>> It is interesting you could build anything "huge" without knowing the
>> var declaration.
>>
>
> Thanks 8)
>
>> It declares the scope of the variable to be in the current function
>> (or global, if you are not in a function definition).
>> Any reference to a variable inside of a function,, that was NOT
>> declared local to that function (using var) refers to the next higher
>> scope or the global scope.
>>
>
> It is exactly the explanations I was searching for !
>
>> It is a crucial thing to understand, perhaps you should read a little
>> tutorial after all.
>>
>
> It seems that I'm using bad keywords for google because I'm not able
> to find a useful tutorial on this specific point. Nevertheless you've
> answered the question !
>
>> cheers, Alex
>>
>
> Thanks,
> Nicolas Terray
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs



More information about the Rails-spinoffs mailing list