1. if
2. switch

let score = window.prompt('请输入您的分数:')score = +score //将string转换为number// 进行比较的时候是 === ,不发生类型转换switch (true) {case score >= 90:alert('优秀')breakcase score >= 80:alert('良好')breakdefault:alert('差')}
3. while


let score = window.prompt('请输入您的分数:')score = +score //将string转换为number// 进行比较的时候是 === ,不发生类型转换switch (true) {case score >= 90:alert('优秀')breakcase score >= 80:alert('良好')breakdefault:alert('差')}

让时间为你证明