<script> function draw(){ var c=document.getElementById("mycanvas"); var cxt=c.getContext("2d"); for(var i=0;i<12;i++){ for(var j=0;j<24;j++){ cxt.fillStyle="rgb(240,"+Math.floor(255-11.5*i)+","+Math.flo
可以通过arguments对象来实现可变的参数 在函数代码中,使用特殊对象 arguments,开发者无需明确指出参数名,就能访问它们. arguments是一个数组对象,可以通过下标来实别参数的位置,通过.length来获参数的个数. 代码实例:我们通过arguments来改变函数的默认参数 <script> function demo(x,y){ x = arguments[0]?arguments[0]:1; //arguments[0]代表demo函数的参数第一个 y = argume