第370天 对a == ('1'||'2'||'3') ? false : true写法进行改进,写出你优化后的方法
a == ('1'||'2'||'3') ? false : true
我也要出题
![1,2,3].includes(+a)or!['1', '2', '3'].includes(a + '')or!{1: true, 2: true, 3: true}[a]
![1,2,3].includes(+a)
!['1', '2', '3'].includes(a + '')
!{1: true, 2: true, 3: true}[a]
!/^[1|2|3]$/.test(a)
@ferrinweb
三种写法!
Most helpful comment
![1,2,3].includes(+a)or
!['1', '2', '3'].includes(a + '')or
!{1: true, 2: true, 3: true}[a]