关于js中的数组
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>获得星期</title> <script type="text/javascript"> var mydate=new Date(); var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]; document.write("今天是:" +weekday[mydate.getDay()]); </script> </head> <body> </body> </html>
在代码中weekday[0]不应该才是星期日吗?
为什么最后返回值不加1?