請大家幫忙看看為什么運行不了呀
<script type="text/javascript">
function big2(x,y){
//定義函數
? var m;
? if(x=y){
??? m=x;
??? return m;
? }
? if(x>y){
??? m=x;
??? return m;
? }
? else if(x<y){
??? m=y;
??? return m;
? }
}
?
//函數體,判斷兩個整數比較的三種情況
req1=big(5,4);
req2=big(6,3);
?
//調用函數,實現下面兩組數中,返回較大值。
? document.write(" 5 和 4 的較大值是:"+req1+"<br>");
? document.write(" 6 和 3 的較大值是:" +req2);
?
</script>
2016-01-07
if(x=y)賦值語句不是比較
2016-01-07
555~改了之后還是不可以吖
2016-01-07
判斷相等是==
if(x=y){改成if(x==y){