2.4 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			2.4 KiB
		
	
	
	
	
	
	
	
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle | 
|---|---|---|---|---|
| 587d7b8d367417b2b2512b5b | Learn About Functional Programming | 1 | Aprenda acerca de la programación funcional | 
Description
INPUT -> PROCESS -> OUTPUT La programación funcional trata sobre: 1) Funciones aisladas: no hay dependencia del estado del programa, que incluye variables globales que están sujetas a cambios 2) Funciones puras: la misma entrada siempre da la misma salida 3) Funciones con efectos secundarios limitados: cualquier cambio o mutación en el estado del programa fuera de la función se controlan cuidadosamente Instructions
prepareTea y getTea ya están definidas para usted. Llame a la función getTea para obtener 40 tazas de té para el equipo y guárdelas en la variable tea4TeamFCC . Tests
tests:
  - text: La variable <code>tea4TeamFCC</code> debe contener 40 tazas de té para el equipo.
    testString: 'assert(tea4TeamFCC.length === 40, "The <code>tea4TeamFCC</code> variable should hold 40 cups of tea for the team.");'
  - text: La variable <code>tea4TeamFCC</code> debe contener tazas de té verde.
    testString: 'assert(tea4TeamFCC[0] === "greenTea", "The <code>tea4TeamFCC</code> variable should hold cups of green tea.");'
Challenge Seed
/**
 * A long process to prepare tea.
 * @return {string} A cup of tea.
 **/
const prepareTea = () => 'greenTea';
/**
 * Get given number of cups of tea.
 * @param {number} numOfCups Number of required cups of tea.
 * @return {Array<string>} Given amount of tea cups.
 **/
const getTea = (numOfCups) => {
  const teaCups = [];
  for(let cups = 1; cups <= numOfCups; cups += 1) {
    const teaCup = prepareTea();
    teaCups.push(teaCup);
  }
  return teaCups;
};
// Add your code below this line
const tea4TeamFCC = null; // :(
// Add your code above this line
console.log(tea4TeamFCC);
Solution
// solution required