Problem

Let’s rage

Just like real life, our old age has brought us a nice mix of wisdom, perspective, and IBS. We’ll try to share all three of those with you in this list of 10 things we’ve learned in the last 100 weeks.

1. Good frameworks borrow, great frameworks steal. And Next proved its greatness earlier this month when they announced that they’d be stealing adopting one of Remix’s killer features, nested routes, into the Next.js Router. But hey, framework competition/innovation is great for developers, so we’re not complaining.

2. If there’s an unintentional bug in our “Spot the Bug” section, we will get an email from literally everyone. Thank you (all 101,741 of you) for your vigilance.

3. Rust isn’t eating the web quite like we thought. Rust has been dominating the tooling space, but the whole “JavaScript is slow, so let’s rewrite our UI in Rust” hasn’t really panned out (at least not yet).

4. Having only high growth tech stocks in your portfolio is a bad idea. And it might be helpful to ask about the liquidation preference of the startup you work at 🙂.

5. Developers love writing CSS… as long as you can trick them into thinking they’re writing HTML. Hats off to Tailwind for figuring this out and becoming the most loved framework in the game.

CarbonQA provides QA services geared for dev teams. They work with your tools, talk with your team in Slack and let your devs be devs (not testers).

function factorial(n) {
  let result = 1;
  for (const i = 1; i < n + 1; i++) {
    result *= i; 
  }
  return result;
}
Solution

For loops work by assigning a value to the variable for each iteration, but variables defined with const can’t be reassigned. Instead, we should use let to define our variable.

function factorial(n) {
  let result = 1;
  for (let i = 1; i < n + 1; i++) {
    result *= i; 
  }
  return result;
}