全球:
myObject = { value: 0 };anObjectName = "myObject";this[anObjectName].value++;console.log(this[anObjectName]);全球:v2
var anObjectName = "myObject";this[anObjectName] = "myvalue"console.log(myObject)
本地:v1
(function() { var scope = this; if (scope != arguments.callee) { arguments.callee.call(arguments.callee); return false; } scope.myObject = { value: 0 }; scope.anObjectName = "myObject"; scope[scope.anObjectName].value++; console.log(scope.myObject.value);})();本地:v2
(function() { var scope = this; scope.myObject = { value: 0 }; scope.anObjectName = "myObject"; scope[scope.anObjectName].value++; console.log(scope.myObject.value); }).call({});


