You could use an array and indexOf
:
if ([1,3,12].indexOf(foo) > -1)
More Related Contents:
- How can I turn a into a link?
- Why can I add named properties to an array as if it were an object?
- Is the order of elements in a JSON list preserved?
- How to compare software version number using js? (only number)
- looping through an object (tree) recursively
- Detecting Back Button/Hash Change in URL
- How to check whether dynamically attached event listener exists or not?
- Accessing Asp.net controls using jquery (all options)
- Create File with Google Drive Api v3 (javascript)
- Higher-order functions in Javascript
- dynamically set iframe src
- Get index of clicked element in collection with jQuery
- How to select first child?
- What is a method that can be used to increment letters?
- Howto: div with onclick inside another div with onclick javascript
- Can an iPhone xcode application read cookies previously stored by Safari Mobile?
- Invoke native date picker from web-app on iOS/Android
- link element onload
- Regex for Umlaut
- HTTP request from Angular sent as OPTIONS instead of POST
- GetUserMedia – facingmode
- How to Detect Cross Origin (CORS) Error vs. Other Types of Errors for XMLHttpRequest() in Javascript
- Why are parenthesis used to wrap a javascript function call? [duplicate]
- Jquery get form field value
- Javascript: hiding prototype methods in for loop?
- How to communicate between Web Components (native UI)?
- How to flatten array in jQuery?
- how to use html2canvas and jspdf to export to pdf in a proper and simple way
- sails.js access controller method from controller method
- How to use the variables from “views.py” in JavasScript, “” in Django Template?