<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>string对象 </title>
<script type="text/javascript">
var mystr = "I love JavaScript!"
document.write(mystr.charAt(mystr.length - 1));
</script>
</head>
<body>
</body>
</html>
这是局限
或者多提交几次,我发现我突然提交成功了
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>string对象 </title>
<script type="text/javascript">
var mystr="I love JavaScript!"
document.write(mystr.charAt(mystr.length-1));
</script>
</head>
<body>
</body>
</html>
跟你一样的
感觉是验证的问题,就是这个作业的答案,必须代码完全一样才行,但作者可能用的不是我们的方法,所以就无法验证成功,但是我们输出结果是对的,就是 !
哪里错了?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>string对象 </title>
<script type="text/javascript">
var mystr = "I love JavaScript!"
document.write(mystr.charAt(mystr.length - 1));
</script>
</head>
<body>
</body>
</html>