19 JavaScript 对象的 with 语句
with ( ParticularObject ) {
..Any old statements ..
}
// 在这些花括号中, ParticularObject 被假定为任何没有指定父对象的特性或方法的缺省对象
with (Math) { // 一个例子
area = PI *r*r; // PI 在 Math 对象中
x= r * cos(theta); // cos 是 Math 对象中的一个方法
y= r * sin(theta); // sin 是 Math 对象中的一个方法
}
Copyright: NPACT