Five Lines of Code - 3. Breaking Down Long Code
π 3.1 Why Five Lines? - Intent
Book Content
My Thoughts
π 3.5 Separating Functions That Do Too Much
Book Content
function reportPrimes(n: number) {
for (let i = 2; i < n; i++) if (isPrime(i)) console.log(`${i} is prime`); // (1) iterate through numbers and (2) check if number is prime
}My Thoughts
PreviousFive Lines of Code - 2. Deep Dive into RefactoringNextFive Lines of Code - 5. Merging Similar Code
Last updated