问答详情
源自:2-10 我或你都可以 (逻辑或操作符)

我的代码哪里错了?

为什么输出正常,慕课却提示我有错误?

http://static.mukewang.com/img/59aa22980001700801660065.jpg

http://static.mukewang.com/img/59aa22980001b19904050050.jpg

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>逻辑或</title>
<script type="text/javascript">
var numa,numb,jq1;
numa=50;
numb=55;
jq1=numa>numb || numa==numb;
document.write("jq1的值是:"+jq1+"<br>");
</script>
</head>
<body>
</body>
</html>


提问者:kw155 2017-09-02 11:17

个回答

  • 慕粉4028731
    2017-09-03 13:46:30
    已采纳

    jq1=numa>numb||numa==numb;不需要空格

  • qq_慕神1420022
    2022-05-17 20:04:52

    听着没问题,说的不错,支持下

    wxpoddnygmpbkynbawdcxegxinkira

  • 一只胡思乱想的猪
    2017-09-22 15:38:48

    运行没问题的,只是会提示错误而已

  • 慕工程6256650
    2017-09-02 11:52:21

    用自己编译器测试比较好! 这个毕竟有很多BUG的!

  • 慕工程6256650
    2017-09-02 11:49:37

    11行 

    jq1=numa>numb || numa==numb;

    ||左右两边没有空格符