JavaScript if 语句使用

var num = parseInt(prompt())

if (num % 2 == 0) {
console.log("偶数")
} else {
console.log("基数")
}
posted @ 2018-11-29 22:37  freeengles  阅读(346)  评论(0编辑  收藏  举报