[Solved] How to find index of object in a array from JSON – Angular 2


The Array.prototype.findIndex() method returns an index of the first element in the array that satisfies the provided testing function.

function isBigEnough(element) {
  return element >= 15;
}

[12, 5, 8, 130, 44].findIndex(isBigEnough); // 3

solved How to find index of object in a array from JSON – Angular 2