src/dream-team.js
/**
 * Create name of dream team based on the names of its members
 *  
 * @param {Array} members names of the members 
 * @return {String | Boolean} name of the team or false
 * in case of incorrect members
 *
 * @example
 * 
 * createDreamTeam(['Matt', 'Ann', 'Dmitry', 'Max']) => 'ADMM'
 * createDreamTeam(['Olivia', 1111, 'Lily', 'Oscar', true, null]) => 'LOO'
 *
 */
Create name of dream team based on the names of its members

@param {Array} members names of the members
@return {String | Boolean} name of the team or false
in case of incorrect members

@example


Create name of dream team based on the names of its members @param { Array } members names of the members @return { String | Boolean } name of the team or false in case of incorrect members @example
function createDreamTeam(members) {
  if(!Array.isArray(members)) {return false;}
  let string = '';
  for(let i = 0; i < members.length; i++) {
    if(typeof members[i] === 'string') {
      members[i] = members[i].trim();
      string += members[i][0].toUpperCase();
    }
    continue;
  }
  return (string.length !== 0) ? string = string.split('').sort().join('') : false;
}
function createDreamTeam ( members ) { if ( ! Array . isArray ( members ) ) { return false ; } let string = '' ; for ( let i = 0 ; i < members . length ; i ++ ) { if ( typeof members [ i ] === 'string' ) { members [ i ] = members [ i ] . trim ( ) ; string += members [ i ] [ 0 ] . toUpperCase ( ) ; } continue ; } return ( string . length !== 0 ) ? string = string . split ( '' ) . sort ( ) . join ( '' ) : false ; }
Create name of dream team based on the names of its members
Create name of dream team based on the names of its members
// throw new NotImplementedError('Not implemented'); // remove line with error and write your code here