sample/common/utils/utils-service.js
function findById(a, id) {
      for (var i = 0; i < a.length; i++) {
        if (a[i].id == id) return a[i];
      }
      return null;
    }
function findById(a, id) {
      for (var i = 0; i < a.length; i++) {
        if (a[i].id == id) return a[i];
      }
      return null;
    }
function findById ( a , id ) { for ( var i = 0 ; i < a . length ; i ++ ) { if ( a [ i ] . id == id ) return a [ i ] ; } return null ; }
Util for finding an object by its 'id' property among an array
Util for finding an object by its id property among an array