Is there an easier way to determine if a variable is equal to a range of values, such as:
if x === 5 || 6
rather than something obtuse like:
if x === 5 || x === 6
?





Rating:
The post comparison – JavaScript: Simple way to check if variable is equal to one of two strings? appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/comparison-javascript-simple-way-to-check-if-variable-is-equal-to-one-of-two-strings.html
No comments:
Post a Comment