老师,帮我检查一下有错误吗?
来源:5-11 编程练习
慕先生8145006
2019-08-31 11:29:57
<!DOCTYPE html>
<html>
<head>
<title>运算符</title>
</head>
<body>
<script type="text/javascript">
//定义字符串hello,imooc!
var str = "hello, imooc!";
//取出子串imooc并输出
console.log(str.substr(7,5));
//定义日期,值为2019-5-1
var d1 = new Date("2019-5-1");
//分别输出年月日的值
console.log(d1.getFullYear());
console.log(d1.getMonth() + 1);
console.log(d1.getDate());
//求一组数20,41,15,8的最大值和最小值并输出
console.log("最大值为:" + Math.max(20,41,15,8));
console.log("最小值为:" + Math.min(20,41,15,8));
</script>
</body>
</html>
1回答
同学写的很棒哦,符合题目要求。继续加油!!
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
相似问题