with就是为了减少代码
<script language="javascript" type="text/javascript">
x = Math.cos(3 * Math.PI);
alert("没有使用with:"+x);
with (Math){ y = cos(3 * PI);}
alert("没有使用with:x"+x+"使用with:y"+y);
</script>
with就是为了减少代码
<script language="javascript" type="text/javascript">
x = Math.cos(3 * Math.PI);
alert("没有使用with:"+x);
with (Math){ y = cos(3 * PI);}
alert("没有使用with:x"+x+"使用with:y"+y);
</script>