大家看看是咋回事
为什么输出了undefined 而不是输出 10 20 30<P>example(x,y);</P>
<P>document.write("调用函数后:<br>");<BR>document.write("基本类型变量的值为:",y,"<br>");<BR>document.write("引用类型数组的值为:");<BR> for(i=0;i<x.length;i++);<BR> document.write(x[i]," ");</P>
<P>function example(a,b)<BR>{<BR>a[0]=10;<BR>a[1]=20;<BR>a[2]=30;<BR>b=50;<BR>document.write("函数中:<br>");<BR>document.write("基本类型变量的值为:",b," ");<BR>document.write("引用类型数组的值为:");<BR> for(i=0;i<a.length;i++)<BR> document.write(a[i]," ");<BR> document.write("<br>");</P>
<P>}</P>
<P></script></P>
<P>调用函数前:<BR>基本类型变量的值为5<BR>引用类型数组的值为:1 2 3 <BR>函数中:<BR>基本类型变量的值为:50 引用类型数组的值为:10 20 30 <BR>调用函数后:<BR>基本类型变量的值为:5<BR>引用类型数组的值为:undefined </P>
<P>咋输出了undefined 而不是输出10 20 30呢? 大哥,帮帮忙啊<BR></P> <P>去看你发的另一个帖子吧</P> 太感谢了真是 都是分号惹的祸~~高手就是细心呀~~~看来想成为一个高手必须得有扎实的基本功才行~~~
页:
[1]
