r/programminghorror • • Aug 02 '26

Javascript my friend didnt know how to use async sleep in javascript, so he wrote this massive chain of .then()

Post image
1.9k Upvotes
async function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms * 1000));
}

// used as:
sleep(0.5).then(() => {
  // ...
  sleep(2.5).then(() => {
    // ...
    sleep(1).then(() => {
      // ...
    }
  }
}

r/programminghorror • • Mar 31 '26

Javascript HELL

Post image
3.1k Upvotes

r/programminghorror • • Jun 09 '26

Javascript Composer 2.5 doesn't know how JS functions work

Post image
180 Upvotes

r/programminghorror • • Sep 16 '25

Javascript On today's episode of "What are you doing JS?"

Post image
903 Upvotes

r/programminghorror • • May 27 '26

Javascript Wanna see some cursed javascript?

32 Upvotes

Imagine that youre in Dantes Inferno in terms of Javascript, where you think its all fine and dandy until you realize each file does the EXACT SAME THING*!!!

Each "layer" of hell in this Github repo will make you wonder why I am:
- Allergic to var, let, AND const
- IIFE as IICE AND IIGE
- Callbacks arent function exclusive, it can host generators AND classes!

So peruse at your own peril, make it a drinking game (within legal age and drinking responsibly of course!) and see how long you can stand this gawdawful code i birthed into the world of programming!

Now have fun, stay safe, God Bless you, and may God spare your braincells!

*Not all files are completed but ongoing!

Edit: to savor some appetites or keyboard warriors wishing me a ctrl+alt+del to my keyboard priviledges:

​​new new new (class Hi {
    constructor(){ 
      console.log("Hi!");
      return Hi;
    }
  })()()();

r/programminghorror • • Aug 28 '26

Javascript Seriously? Recursive Regex?

Post image
566 Upvotes

r/programminghorror • • Jun 12 '25 This

Javascript Javascript is filled with horror

Post image
2.4k Upvotes