An old-fashioned electric typewriter on a desk, with a piece of paper coming out of it showing faces and animals made out of typed characters.

Tagged: javascript

There is 1 post tagged "javascript."

Home - Resume - Projects - BlogRSS Feed

From Sunday, April 27th, 2025

JavaScript Promises Break Code in Half

“Promises” are a ubiquitous feature in the JavaScript language. For example, if you call the function fetch in order to get some kind of JSON object from an API, fetch will return a Promise:

const thisIsAPromise = fetch("/api/get-id/1");

What does that mean? The MDN documentation informs us that a Promise “is a proxy for a value not necessarily known when the promise is created.” That’s kind of true, and for a while, I even believed it. However, nowadays, I think that it’s actually easier to think of Promises as a way to manage code, not data.

Read More right-pointing flowery thing

Tagged as computers, javascript, explainers.