2 Minute Tut: AE Scripting/Javascript Global Namespace

One of the tricky things about Javascript is that it is a loosely-typed, very forgiving programming language. You don’t have to give a variable a “type” (i.e. integer, float, string, binary, etc.) and it doesn’t strictly enforce uniqueness of variable/function names.  On top of that, as an interpreted language, variable contamination can’t be caught until runtime.  This becomes even more problematic when introducing code run in the global namespace (which can also be referred to as the global scope or global context).

Check out the short tutorial above for a little more background on why this can be a problem in After Effects scripting (and Javascript in general), and a couple of techniques for getting around this.

Further Reading: