P
Size: a a a
P
P
P
function f(foo, values) {
with (foo) {
console.log(values);
}
}
If you call f([1,2,3], obj)
in an ECMAScript 5 environment, then the values
reference inside the with
statement will resolve to obj
. However, ECMAScript 6 introduces a values
property on Array.prototype (so that it will be available on every array). So, in a JavaScript environment that supports ECMAScript 6, the values
reference inside the with
statement will resolve to [1,2,3].values
.DM
DM
P
DM
DM
DM
P
P
DM
DM
DM
DM
DM
P
P
DM