how to print the index value for of loop in javascript code example
Example: javascript for loop return index
const targetindex = myarray.findIndex(item => item.name === 'xyz');
const targetindex = myarray.findIndex(item => item.name === 'xyz');