Scoping: Local vs Var
问题 I'm new to CF so this may be a basic question. But I've heard I should use local for objects inside functions due to how scoping works in CF. But what about 'var'? Is var the same as using local? e.g. function MyFunction() { local.obj = {}; } Is this the same as: function MyFunction() { var obj = {}; } If they aren't the same, what is the difference between them? And when should I be using either of them? 回答1: They are very similar, but not exactly the same. Both only exist inside of a