大于(>), 小于(<)运算符
javascript
字符串在进行大于(小于)比较时,会根据第一个不同的字符的ASCII
值码进行比较。
1、当数字number
与字符串string
进行比较大小时,会强制的将数字number
转换成字符串string
然后再进行比较
2、当日期字符串比较,如果,没有具体时分秒,则转为00:00:00
进行比较
console.log('2020-10-10 09:00' > '2020-10-10') //true
console.log('2020-10-01' > '2020-10-10') //false
console.log('2020-10-10 00:01' > '2020-10-10') //true
console.log('2010-10-10' < '2020-10-10') //true