JSFiddle - React, Tailwind, and code Playground
by Sahin Deniz
JavaScript
let moderators = [{
index: 1,
moderating: true,
},
{
index: 2,
moderating: true,
}
]
let result = moderators.some(moderator => {
let currentIndex = 2;
return (
moderator.index == currentIndex||
!moderator.moderating
);
});
console.log(result);