課程
/前端開發(fā)
/JavaScript
/JavaScript進階篇
function? ggg(){??max = x<y ? x:y ??reture? max;?}?ggg(5,6);?document.write(max);
2017-01-03
源自:JavaScript進階篇 6-1
正在回答
max是函數內的數,不能用于函數外,你在外面的ggg()函數調用時有兩個參數,則在聲明函數時需要將參數加入ggg()中,如function ggg(x,y);第一個表達式沒有";",最好定義下max變量,好習慣
function ggg(x,y)
{
return (x>y?x:y);
}
document.write(ggg(5,6));
document.write(max);改成document.write(ggg(5,6));
同學??reture 和 ?return ??那個對?????
<script type="text/javascript">
? ? ? function ggg(x, y) { ? ? ? ? ? //這里需要兩個參數(形參)
? ? ? ? var max = x<y ? x : y;
? ? ? ? return max; ? ? ? ? ? ? ? ? //這里是return不是reture
? ? ? }
? ? ? document.write(ggg(15,6));
? ? </script>
function? ggg(x,y){? max = x>y ? x:y; ? return? max;?}?max=ggg(5,6);?document.write(max);
function? ggg(x,y)
{??max = x<y ? x:y;???reture? max;?}?max=ggg(5,6);?document.write(max);
方法上面不應該有x,y兩個形參嗎?
舉報
本課程從如何插入JS代碼開始,帶您進入網頁動態(tài)交互世界
3 回答請問為什么報錯
3 回答為什么頭文件一直報錯
1 回答為什么試著用while 寫 為什么會報錯????求解
3 回答為什么寬高加了px 就報錯?
2 回答為什么我的刪除會報錯呢?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-09-12
max是函數內的數,不能用于函數外,你在外面的ggg()函數調用時有兩個參數,則在聲明函數時需要將參數加入ggg()中,如function ggg(x,y);第一個表達式沒有";",最好定義下max變量,好習慣
function ggg(x,y)
{
return (x>y?x:y);
}
document.write(ggg(5,6));
2017-08-10
document.write(max);改成document.write(ggg(5,6));
2017-06-28
同學??reture 和 ?return ??那個對?????
2017-03-18
<script type="text/javascript">
? ? ? function ggg(x, y) { ? ? ? ? ? //這里需要兩個參數(形參)
? ? ? ? var max = x<y ? x : y;
? ? ? ? return max; ? ? ? ? ? ? ? ? //這里是return不是reture
? ? ? }
? ? ? document.write(ggg(15,6));
? ? </script>
2017-01-16
function? ggg(x,y)
{
? max = x>y ? x:y;
? return? max;
?}
?max=ggg(5,6);
?document.write(max);
2017-01-12
function? ggg(x,y)
{
??max = x<y ? x:y;?
??reture? max;
?}
?max=ggg(5,6);
?document.write(max);
2017-01-03
方法上面不應該有x,y兩個形參嗎?