Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: reactjs cut part of string 
Javascript :: how to remove a specific element from array in javascript 
Javascript :: build apk from react native 
Javascript :: ref focus not working vue js 
Javascript :: preload 
Javascript :: get element by id jqueryt 
Javascript :: discord.js.Client 
Javascript :: make input not editable for user js 
Javascript :: javascript set class on div 
Javascript :: complete math objects in javascript 
Javascript :: js remove first element from array 
Javascript :: push data to firebase javascript 
Javascript :: file upload javascript 
Javascript :: tonumber javascript 
Javascript :: vue get if checkbox is checked 
Javascript :: export default method vue 
Javascript :: formgroup is not property of form angular 
Javascript :: pattern validator angular 
Javascript :: react render component after data loaded 
Javascript :: socket io emit to socket id 
Javascript :: remove .html from url express js 
Javascript :: how to find last element in array in javascript 
Javascript :: javascript Sum of a sequence 
Javascript :: async await javascript stack overflow 
Javascript :: javascript get call stack 
Javascript :: how to check if an element exists in an array of objects js 
Javascript :: jquery selector parent on hover 
Javascript :: javascript get main color from image 
Javascript :: pass data from child to parent react 
Javascript :: react native vector icons not showing 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =