<!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>
</body>
<script>
function pan() {
var c = 0
var a = Number
for (var b = 2; b <= a; b++) {
if (a % b === 0) {
c = 1
break
}
}
if (c === 0) {
console.log("是素数")
} else {
console.log("不是素数")
}
}
pan(5)
</script>
</html>