var globalObject = { x: 0 }; // some global object with 'x' property
function Object()
{
this.x = 0;
}
Object.prototype.TestPerformance = function()
{
var xVar = 0;
}
從函數TestPerformance
,這些屬性/變量的訪問時間的順序是什麼?JavaScript性能:訪問時間的屬性 - 'this'與'全局對象'vs'變量'
this.x
VS globalObject.x
VS xVar
是'x'在'this.x'情況下,自己的財產? – Oriol
你爲什麼想知道? (只是爲了給你一個更好的答案) – mostruash
你是什麼意思的「秩序」?如果你想要數字,你必須測量(關於你正在使用的確切實現) – Bergi