sumq=req1+req2;
sumq=req1+req2;這塊,為何我寫成req1+req2=sumq就不行呢?。?!
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>返回值函數(shù)</title> <script?type="text/javascript"> ??function??app2(x,y) ??{?var?sum,x,y; ????sum?=?x?*?y; ????return?sum; ??} ?req1=app2(5,6); ?req2=app2(2,3); sumq=req1+req2; document.write("req1的值:"+req1+"<br/>"); document.write("req2的值:"+req2+"<br/>"); document.write(req1+"與"+req2+"和:"+sumq); </script> </head> <body> </body> </html>
2015-03-05
= 的作用是賦值的,
在代碼中,執(zhí)行順序的從右到左的
= 將右邊的賦給了左邊的變量
2014-12-23
邏輯問題。
2014-12-23
賦值是從右向左的