最新回答 / qq_Alliswell_5
遇同样问题,应该是mydate 是定义值, mydate.setTime 是个执行动作,这样理解吗?返回只能返回值不能返回动作。不晓得对不
2015-05-06
var arr=["*","##","***","&&","****","##*"]
arr[7]="**";
document.write(arr.length+"<br>");
for(i=0;i<arr.length;i++){
document.write(arr[i]+"<br>")}
document.write(arr[0]+"<br>"+arr[7]+"<br>"+arr[2]+"<br>"+arr[4])
arr[7]="**";
document.write(arr.length+"<br>");
for(i=0;i<arr.length;i++){
document.write(arr[i]+"<br>")}
document.write(arr[0]+"<br>"+arr[7]+"<br>"+arr[2]+"<br>"+arr[4])
function compare(a,b)//定义函数
{
if(a>b) return a;
else if(a==b) return"两值相同"
else return b;
}
//函数体,判断两个整数比较的三种情况
//调用函数,实现下面两组数中,返回较大值。
document.write(" 5 和 4 的较大值是:"+compare(5,5)+"<br>");
document.write(" 6 和 3 的较大值是:"+compare(4,6) );
{
if(a>b) return a;
else if(a==b) return"两值相同"
else return b;
}
//函数体,判断两个整数比较的三种情况
//调用函数,实现下面两组数中,返回较大值。
document.write(" 5 和 4 的较大值是:"+compare(5,5)+"<br>");
document.write(" 6 和 3 的较大值是:"+compare(4,6) );
<script type="text/javascript">
function app2(x,y)
{ var sum,x,y;
sum = x * y;
return sum;
}
var req1=app2(5,6);
var req2=app2(2,3);
var sumq=app2(req1,req2);
document.write("req1的值:"+req1+"<br/>");
document.write("req2的值:"+req2+"<br/>");
document.write(req1+"与"+req2+"和:"+sumq);
function app2(x,y)
{ var sum,x,y;
sum = x * y;
return sum;
}
var req1=app2(5,6);
var req2=app2(2,3);
var sumq=app2(req1,req2);
document.write("req1的值:"+req1+"<br/>");
document.write("req2的值:"+req2+"<br/>");
document.write(req1+"与"+req2+"和:"+sumq);
2015-05-06