app/services/stockUpdate.js
/**
 * Finds the corresponding ticker for a company with the given name.
 * @param {name} name
 * @returns {string} - the ticker, or undefined if no such company exists
 */
Finds the corresponding ticker for a company with the given name.
@param {name} name
@returns {string} - the ticker, or undefined if no such company exists
Finds the corresponding ticker for a company with the given name . @param { name } name @returns { string } - the ticker or undefined if no such company exists
function findTickerForCompanyWithName(name) {
  for (var i=0; i<config.companies.length; i++) {
    var company = config.companies[i];
    if (name === company.name) {
      return company.ticker;
    }
  }
  return undefined;
}
function findTickerForCompanyWithName ( name ) { for ( var i = 0 ; i < config . companies . length ; i ++ ) { var company = config . companies [ i ] ; if ( name === company . name ) { return company . ticker ; } } return undefined ; }
Finds the corresponding ticker for a company with the given name.
Finds the corresponding ticker for a company with the given name .