JSFiddle - React, Tailwind, and code Playground

by Diana Lemen

JavaScript

const A = [5,2,4,6,1,3];
const searchValue = 6;
let indexOfSearhedValue = null;
for(let i = 0; i <= A.length; i++) {
	if (A[i] === searchValue) {
  	indexOfSearhedValue = i;
  }
}
console.log(indexOfSearhedValue);