Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if array contains an item javascript

let isInArray = arr.includes(valueToFind[, fromIndex])
// arr         - array we're inspecting
// valueToFind - value we're looking for
// fromIndex   - index from which the seach will start (defaults to 0 if left out)
// isInArray   - boolean value which tells us if arr contains valueToFind
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #check #array #item #javascript
ADD COMMENT
Topic
Name
3+3 =