function existe(arreglo, numero) {
return arreglo.indexOf(numero) !== -1;
}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
More Related Contents:
- Hover over image to get a box with multiple links in html/JavaScript
- Array data to be filled into a table using JavaScript
- window.onload vs document.onload
- Detect the Internet connection is offline?
- How to set File objects and length property at FileList object where the files are also reflected at FormData object?
- changing source on html5 video tag
- Is the Promise constructor callback executed asynchronously?
- Regular expression to match A, AB, ABC, but not AC. (“starts with”)
- Rendering to JS with Jinja produces invalid number rather than string
- How does the messages-count example in Meteor docs work?
- Unsafe JavaScript attempt to access frame in Google Chrome
- How to move an iFrame in the DOM without losing its state?
- Mongoose/MongoDB result fields appear undefined in Javascript
- fetch gives an empty response body
- HTML2canvas generates Blurry images
- Vue.js: Conditional class style binding
- HTML5 video, how to detect when there is no audio track?
- screen styling when virtual keyboard is active
- When should I automatically create an object even if `new` is forgotten?
- Use firebase cloud function to send POST request to non-google server
- The reason to use JS .call() method?
- Is there any polyfill for current CSS Flexible Box Layout Module as per W3C CR (display: flex etc.)? [closed]
- How can I duplicate a div onclick event?
- Refresh element generated by a django template
- Is there a way to know if a link/script is still pending or has it failed
- Why I am not getting warnings about StrictNullChecks in typescript
- React Router BrowserRouter leads to “404 Not Found – nginx ” error when going to subpage directly without through a home-page click
- CKEditor: Class or ID for editor body
- Javascript – key / certificate from USB Token
- JQuery Modal Boxes and Iframe