findIndex() method issue with internet explorer

So my question is how can i do differently to get my index for every browser ?

You have at least three options:

  1. Shim Array#findIndex; MDN has a shim/polyfill you can use.

  2. Use something else that IE11 has, such as Array#some (which even IE9 has):

    var index = -1;
    items.some(function(el, i) {
        if (el.name == paramProgramName) {
            index = i;
            return true;
        }
    });
    
  3. Use something else that even IE8 has, such as for:

    var index = -1;
    for (var i = 0; i < items.length; ++i) {
        if (items[i].name == paramProgramName) {
            index = i;
            break;
        }
    }
    

you can use http://underscorejs.org/,

how to use:

var index = _.findIndex(objects, function(item){
return item.name == programName;
});