Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check if array of dictionaries contain

const myArray = [{key1: "value1", key2: "value2"}, {key1: "value4", key2: "value8"}, {key1: "value1", key2: "value3"}, {key1: "value1", key2: "value32"}]
  
if(myArray.some(e => e.key1 == 'value1')) {
  console.log('Exists');
}
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #check #array #dictionaries
ADD COMMENT
Topic
Name
7+6 =