Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
let sum = 60;
if(sum < 0 && sum > 100){
console.log("成绩不能小于0或大于100")
}else if(sum >= 60 && sum <= 79){
console.log("良好");
}else if(sum >= 80 && sum <= 89){
console.log("中等");
}else if(sum >= 90 && sum <= 100){
console.log("优秀");
}else if(sum < 60){
console.log("不及格");
}
let count = 1
while(count <= 10){
console.log("循环");
count ++;
}
let arr = ['a','b','c','d','e','f','g'];
for(let i = 0;i < arr.length; i ++){
console.log(arr[i]);
}
console.log("数组长度:"+arr.length); //返回数组长度
console.log("查找数组中字符首次出现的位置:"+arr.indexOf('g')); //查找数组中 g 首次出现的位置
console.log("提取部分字符含头不含尾:"+arr.slice(1,4)); //提取部分字符(截取结果,包含起始位置,不包含终止位置)
console.log("提取部分字符包含头尾:"+'asdfqwer'.substr(1,4)); //提取部分字符(截取结果,包含起始位置与终止位置)
console.log("替换字符:"+'asdfqwer'.replace('qw','替换')); //替换字符
console.log("大小写转换:"+'asdfqwer'.toUpperCase()); //转换为大写 (toLowerCase() 转换为小写; trim()去除空格,等等常用方法可查询js API)
</script>
</body>
</html>