Answers for "multiple confition checking jasvascript"

1

multiple confition checking jasvascript

// 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) { }
Posted by: Guest on July-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language