tyler

星期一 09 晚上 二月 10o 2025

Bytes: Erasing TypeScript

Bytes: Erasing TypeScript

Cool Bits logo

Cool Bits

  1. Alex MacArthur wrote about how there are a lot of ways to break up long tasks in JavaScript. There are also a lot of ways to break up with your significant other right before Valentine’s Day, but I typically find faking my own death to be the cleanest option.

  2. The Bit team revealed how they leveraged composability to stitch together hundreds of applications into a unified platform, bridging the Application Integration Gap. [sponsored]

  3. Midscene.js lets you use AI to operate web pages, validate content, and extract data. Your move, EU cookie banners.

  4. Prisma is migrating their core logic from Rust to TypeScript – and you know the Rust mafia is already preparing for war in some unspeakable Discord server.

  5. Christian Ekrem wrote about the Single Responsibility Principle in React.

  6. The Clerk squad created this Step-by-step guide to building a Next.js sign-up form with React Hook Form, Argon2, Drizzle, Zod, and shadcn/ui. [sponsored]

  7. Open Deep Research is an open-source implementation of OpenAI’s new Deep Research agent that provides the same capabilities without charging you $200. You can check it out now, or just wait 20 minutes for Fireship to make a video on it.

  8. The ESLint team wrote about the differences between ESLint and TypeScript. Difference #1: Microsoft doesn’t pay ESLint team members $400k/yr 😭.

  9. Matteo Collina wrote a quick PSA to remind us all that you should not use URLPattern to route HTTP requests on the server.

  10. Maxime Heckel wrote about how post-processing shaders can be a creative medium. I was skeptical at first, but after seeing Tim Robinson turn yesterday’s Pizza Rolls commercial into a 30-second work of art, I’m ready to believe that anything can be a creative medium.


Pop Quiz logo

Pop Quiz: Answer

function first () {
  var name = 'Jordyn'

  console.log(name)
}

function second () {
  var name = 'Jake'

  console.log(name)
}

console.log(name)
var name = 'Tyler'
first()
second()
console.log(name)

We get undefined, Jordyn, Jake, then Tyler. What this shows us is that you can think of each new Execution Context as having its own unique variable environment. Even though there are other Execution Contexts that contain the variable name, the JavaScript engine will first look to the current Execution Context for that variable.

For more info (and to see a cool GIF on how the JS interpreter evaluates the code above that I would include here but honestly I’m not sure how different email clients support GIFs), visit The Ultimate Guide to Hoisting, Scopes, and Closures in JavaScript

Bytes

Want us to say nice things

about your company?

Sponsor Bytes

or share it

Built with ❤️ by ui.dev

50 W Broadway Ste 333 PMB 51647 Salt Lake City, Utah 84101

发布者