JSFiddle - React, Tailwind, and code Playground

by David Santiago

JavaScript

const array=[{name:1},{name:2}];
const value = 2;

        const hasMatchingRole = array.some(obj => obj.name === value);

console.log(hasMatchingRole);