toma 馃, si llegaste hasta aqu铆 te mereces un aguacate.
Introducci贸n al Clean Code
Deuda t茅cnica y refactorizaci贸n de c贸digo
Reglas del dise帽o simple
Qu茅 es Clean Code
Nombre y uso de las variables
Uso correcto de var, let y const
Reglas para la nomenclatura
C贸mo nombrar seg煤n el tipo de dato
Ejercicio: Nombra correctamente seg煤n su tipo de dato
脕mbito de las variables
脕mbito global
脕mbito local o de funci贸n
脕mbito de bloque
脕mbito est谩tico
Hoisting
Funciones
Declaraci贸n y expresi贸n de funciones
Par谩metros y argumentos
Funciones de flecha y el this
Clases
POO con ES6 (constructores, m茅todos y herencia)
Herencia en JavaScript
Tama帽o reducido (responsabilidad 煤nica)
Organizaci贸n
Optimizaciones
Cu谩ndo usar comentarios
Formato coherente (codear en equipos)
Principio DRY
Notaci贸n big O
Cierre
Sigue aprendiendo JavaScript
You don't have access to this class
Keep learning! Join and start boosting your career
Contributions 8
Questions 0
toma 馃, si llegaste hasta aqu铆 te mereces un aguacate.
Principio DRY: Don鈥檛 repeat yourself (No te repitas a ti mismo).
No repetir c贸digo, sino extraerlo a una clase o funci贸n para poder reutilizarlo.
// Obtener un promedio
// Ejemplo de c贸digo que se repite
const juanAverage = (90 + 50 + 70) / 3;
const alexAverage = (80 + 90 + 70 + 80) / 4;
const candeAverage = (40 + 100) / 2;
console.log(juanAverage, alexAverage, candeAverage);
// Soluci贸n del c贸digo anterior para ser reutilizado
function getAverage(...grades) {
return grades.reduce((prev, current) => prev + current, 0) / grades.length;
}
const juanAverage2 = getAverage(90 + 50 + 70);
const alexAverage2 = getAverage(80 + 90 + 70 + 80);
const candeAverage2 = getAverage(40 + 100);
console.log(juanAverage2, alexAverage2, candeAverage2);
ME ENCANTO ESTE CURSO, me puse arrevisar mi codigo, y valla que cantidad de errores cometia
Para entender mejor el metodo reduce, les recomiendo esta clase:
https://platzi.com/clases/2461-arrays/40876-reduce/
Espero que mi aporte les ayude 馃槂
Dry aplicado a una soluci贸n que convierte los Fahrenheit a Celsius.
Want to see more contributions, questions and answers from the community?