📅  最后修改于: 2022-03-11 15:02:39.455000             🧑  作者: Mango
// A sometimes useful shorthand
if (value === 1 || value === 'one' || value === 2 || value === 'two') { }
// This achieves the same:
// Can be useful for long strings etc..
if ([1, 'one', 2, 'two'].indexOf(value) >= 0) { }