JSFiddle - React, Tailwind, and code Playground

by pierian_design

JavaScript

var a = [1, 2, 3, 4];

console.log(a.findIndex(el => el > 2));