JSFiddle - React, Tailwind, and code Playground

by irinablue

JavaScript

const matchedElements = ['a', 'b', 'c'];

const indexElement = [...matchedElements].indexOf('a');
console.log('indexElement', indexElement)
if (indexElement !== -1) console.log('if true')