From MDN:
Using
with
is not recommended, and is forbidden in ECMAScript 5 strict mode. The recommended alternative is to assign the object whose properties you want to access to a temporary variable.
It seems like a great/useful/convenient feature. Why is it frowned upon? What other ways are there to achieve that effect? I don't want to have to go:
veryLongNS.y = veryLongNS.myFunc(veryLongNS.x);
veryLongNS.z = 6;
veryLongNS.otherFunc();
veryLongNS.a = {
a:1,
b:2,
c:veryLongNS.processThree(3)
};