和其他語言一樣,JavaScript也有條件語句對流程上進行判斷。包括各種操作符合邏輯語句
比較操作符
常用的比較操作符有 等于 == , 不等于!= , 大于 >, 小于 <,大于等于 >= ,小于等于 <=
document.write("Study" == "study");//false
document.write("Study" < "study"); //false
document.write("Study".toUpperCase())//STUDY
document.write("Study".toLowerCase() == "study".toLowerCase()+"<br>");//true 利用toLowerCase()和toUpperCase()進行大小寫轉(zhuǎn)換
以上就是關于javascript比較操作符的相關內(nèi)容了,希望小伙伴們能夠喜歡