<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
</style>
</head>
<body>
<div class="container">
</div>
<script>
function getMax() {
let max = arguments[0]
for (var i = 1; i < arguments.length; i++) {
if (arguments[i] > max) {
max = arguments[i]
}
}
return max
}
function arrReverse() {
let newArr = []
for (let j = arguments.length - 1; j >= 0; j--) {
newArr[arguments.length - j - 1] = arguments[j]
}
return newArr
}
function arrSort() {
for (var i = 0; i < arguments.length - 1; i++) {
for (var j = 0; j < arguments.length - i - 1; j++) {
if (arguments[j] > arguments[j + 1]) {
var temp = arguments[j]
arguments[j] = arguments[j + 1]
arguments[j + 1] = temp
}
}
}
return arguments
}
function isRuiYear(year) {
var flag = false
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
flag = true
}
return flag
}
function get2Mdays(year) {
return isRuiYear(year) ? 29 : 28
}
console.log(arrReverse(3, 4, 56, 2, 123, 12, 12))
console.log(getMax(23, 323, 645, 34, 1234, 35))
console.log(arrSort(23, 323, 645, 34, 1234, 35))
console.log(isRuiYear(2000))
console.log(get2Mdays(2000))
console.log(get2Mdays(1994))
</script>
</body>
</html>