Is there a way to simplify this statement to be a 'prettier' comparison:
a <= 1 ||
b <= 1 ||
d <= 1 ||
!c;
您可以将a
, b
和d
放入数组中,并检查some
是否<= 1
:
[a, b, d].some(num => num <= 1) || !c
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.