JavaScript code, judged.

35 JavaScript posts rated by Ewwsers · average 7.8 EWW. Beautiful, cursed and questionable JavaScript, scored 0 to 10 and roasted in the Roast Pit.

friday_deploy
@friday_deploy House
2d · javascript · 0 views
Migrate on read
javascript6 lines
8.7/10
HAUNTED
Rated by 26 Ewwsers
The crowd built a small shrine and backed away.
AI ROASTFired at 16 ratings - once per post

Every time someone loads the product list you run DDL on the table. You wrote a GET endpoint that bullies the schema on every damn request. Calling it "migrate on read" like it's clever is the scariest part.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
regex_priest
@regex_priest House
3d · javascript · 1 views
Strip the HTML
javascript6 lines
7.6/10
CURSED
Rated by 20 Ewwsers
This code has lore. Dark lore.
AI ROASTFired at 12 ratings - once per post

You named the function "stripTags" and then rendered the result straight into innerHTML with a comment calling it sanitized — that's not sanitization, that's a bouncer who checks IDs by asking if you have one. `onerror=alert(1)` walks right past your little regex and gets handed the keys.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
nested_ternary
@nested_ternary House
5d · javascript · 2 views
Shipping cost
javascript4 lines
7.0/10
NASTY
Rated by 19 Ewwsers
The crowd built a small shrine and backed away.
AI ROASTFired at 12 ratings - once per post

You nested five ternaries into a single return with zero parentheses, so every reader has to parse your operator precedence in their head like it's a punishment. Buffer overflow of the eyes would've been kinder.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
print_debugger
@print_debugger House
6d · javascript · 0 views
Checkout, instrumented
javascript9 lines
8.8/10
EWW
Rated by 26 Ewwsers
The Ewwsers have seen things. This is the things.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
global_state
@global_state House
7d · javascript · 1 views
Shared app state
javascript10 lines
7.8/10
DEEPLY CURSED
Rated by 19 Ewwsers
The Ewwsers recoiled in unison.
AI ROASTFired at 12 ratings - once per post

You're toggling `isLoading` on every addToCart, so the spinner's job is now inexplicably tied to cart contents. Somewhere a support ticket is being born that says the app is permanently loading because someone added twelve things.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
callback_hell
@callback_hell House
7d · javascript · 1 views
A promise, technically
javascript11 lines
6.8/10
NASTY
Rated by 17 Ewwsers
The crowd built a small shrine and backed away.
AI ROASTFired at 11 ratings - once per post

You wrapped a chain of promises in another promise for absolutely no goddamn reason. You invented a fourth callback pyramid because the async/await pyramid was too honest for you. That promise executor won't reject either, so the first fetch error resolves into hell silently.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
friday_deploy
@friday_deploy House
8d · javascript · 1 views
Deploy on green
javascript8 lines
7.6/10
CURSED
Rated by 19 Ewwsers
Cursed. Confirmed by committee.
AI ROASTFired at 12 ratings - once per post

Setting `result.failed = 0` doesn't fix the tests, it just fixes the number you have to look at. That's not a deploy script, that's a confession with the timestamp built in.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
friday_deploy
@friday_deploy House
29d · javascript · 0 views
Retry until it works
javascript9 lines
8.0/10
DEEPLY CURSED
Rated by 23 Ewwsers
Cursed. Confirmed by committee.
AI ROASTFired at 23 ratings - once per post

An infinite retry loop with no cap, no delay, no backoff. You built a denial-of-service attack and pointed it at your own API, and the comment says it will work eventually like that's a plan and not a prayer.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
clean_coder
@clean_coder House
29d · javascript · 0 views
A debounce that just works
javascript7 lines
1.7/10
CLEAN
Rated by 14 Ewwsers
Genuinely nice. Nobody knows how to act.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
friday_deploy
@friday_deploy House
29d · javascript · 0 views
Equality, loosely
javascript4 lines
8.4/10
HAUNTED
Rated by 24 Ewwsers
The crowd built a small shrine and backed away.
AI ROASTFired at 24 ratings - once per post

Three progressively worse ways to avoid learning how == works, culminating in stringifying everything and praying. same(null, undefined) prints true and that's not a bug, that's a séance.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
magic_number
@magic_number House
29d · javascript · 2 views
You know why
javascript7 lines
7.2/10
NASTY
Rated by 18 Ewwsers
Somebody's on-call phone just rang on its own.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
print_debugger
@print_debugger House
29d · javascript · 0 views
Production logging strategy
javascript12 lines
7.6/10
CURSED
Rated by 19 Ewwsers
Somebody's on-call phone just rang on its own.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
todo_forever
@todo_forever House
29d · javascript · 0 views
Temporary fix
javascript7 lines
8.3/10
HAUNTED
Rated by 19 Ewwsers
The Ewwsers recoiled in unison.
AI ROASTFired at 14 ratings - once per post

Three years and two Tuesdays a week of every single production user getting flashbanged by a reload the function above swears cannot happen. That comment dated 2021 is the only archaeology left of somebody who meant to fix it and didn't.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
stringly_typed
@stringly_typed House
30d · javascript · 0 views
Boolean logic
javascript7 lines
7.1/10
NASTY
Rated by 14 Ewwsers
Somebody's on-call phone just rang on its own.
AI ROASTFired at 9 ratings - once per post

Your entire authorization model is "if confused, grant." The else branch literally comments its own guess and hands over the keys — that's not security, that's a bouncer who lets everyone in and hopes for the best.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
copy_pasta
@copy_pasta House
31d · javascript · 0 views
Is it an array though
javascript7 lines
7.8/10
DEEPLY CURSED
Rated by 18 Ewwsers
Cursed. Confirmed by committee.
AI ROASTFired at 14 ratings - once per post

You rebuilt Array.isArray from vibes and a push check, so anything with a length and a push is now legally an array. Congratulations, you've invented duck typing for the one function JavaScript already shipped correctly in 2009.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
sleepy_sync
@sleepy_sync House
32d · javascript · 1 views
Wait for the DOM
javascript12 lines
7.6/10
CURSED
Rated by 20 Ewwsers
The Ewwsers recoiled in unison.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
copy_pasta
@copy_pasta House
35d · javascript · 0 views
Deep clone, enterprise edition
javascript5 lines
7.0/10
NASTY
Rated by 18 Ewwsers
The crowd built a small shrine and backed away.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
global_state
@global_state House
36d · javascript · 0 views
State management
javascript9 lines
7.9/10
DEEPLY CURSED
Rated by 19 Ewwsers
This code has lore. Dark lore.
AI ROASTFired at 12 ratings - once per post

`clearData` reassigns `data` to a fresh object while `window.data` keeps pointing at the corpse of the old one, so your "global state" is now two disconnected piles of shit with the same name. Congratulations, you built a memory leak and a lie in four words.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
sleepy_sync
@sleepy_sync House
37d · javascript · 1 views
Wait for the DOM
javascript12 lines
9.0/10
EWW
Rated by 26 Ewwsers
The crowd gagged in perfect harmony.
AI ROASTFired at 19 ratings - once per post

You wrote a polling loop with setTimeout to wait for jQuery like it's 2009 and the CDN is on dial-up. This isn't initialization, it's a stalker checking if the DOM is awake yet.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
copy_pasta
@copy_pasta House
37d · javascript · 0 views
Deep clone, enterprise edition
javascript5 lines
6.6/10
GROSS
Rated by 12 Ewwsers
Somebody's on-call phone just rang on its own.
AI ROASTFired at 8 ratings - once per post

You named it deepClone and then handed it a Date, a function and a BigInt, three things JSON.stringify round-trips into either silence or a string. You didn't clone the object, you photocopied it through a fax machine and called the smudge a feature.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
friday_deploy
@friday_deploy House
37d · javascript · 0 views
Retry until it works
javascript9 lines
7.8/10
DEEPLY CURSED
Rated by 22 Ewwsers
The crowd built a small shrine and backed away.
AI ROASTFired at 13 ratings - once per post

while true with an empty catch and no delay. You didn't write retry logic, you wrote a DDoS against your own server with a side of eternal spin. That comment is doing more work than the function ever will.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
copy_pasta
@copy_pasta House
37d · javascript · 0 views
Is it an array though
javascript7 lines
8.3/10
HAUNTED
Rated by 22 Ewwsers
Somebody's on-call phone just rang on its own.
AI ROASTFired at 12 ratings - once per post

You reinvented Array.isArray by checking if the thing has a length and a push, which means your function proudly reports a string as an array. "abc".length and "abc".push both exist in the neighborhood you didn't check.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
nested_ternary
@nested_ternary House
37d · javascript · 0 views
Readable if you squint
javascript1 lines
8.5/10
HAUNTED
Rated by 21 Ewwsers
The Ewwsers recoiled in unison.
AI ROASTFired at 21 ratings - once per post

This is a ternary daisy chain wearing a trenchcoat. You wrote a decision tree with no trunk and expected the reader to just vibe with it, and the isRetired check buried four branches deep is a jump scare with a pension.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
print_debugger
@print_debugger House
37d · javascript · 0 views
Production logging strategy
javascript12 lines
7.0/10
NASTY
Rated by 16 Ewwsers
Cursed. Confirmed by committee.
AI ROASTFired at 10 ratings - once per post

here, here 2, in loop, total now, here 3. You wrote a function that talks to itself more than it calculates, like a toddler narrating a shit.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
friday_deploy
@friday_deploy House
37d · javascript · 0 views
Fixed the race condition
javascript5 lines
8.9/10
EWW
Rated by 26 Ewwsers
Roasters formed an orderly queue around the block.
AI ROASTFired at 21 ratings - once per post

Removing `await` to "fix" the race and then just sleeping two seconds hoping the database catches up is not a fix, it's a hostage negotiation with a clock. That `// give it time` comment is you admitting you don't know what the hell is happening, so you made the computer wait and pray like everyone else.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
callback_hell
@callback_hell House
37d · javascript · 0 views
Just one more callback
javascript13 lines
8.7/10
HAUNTED
Rated by 23 Ewwsers
This code has lore. Dark lore.
AI ROASTFired at 12 ratings - once per post

Seven callbacks deep and console.log is the only thing getting closure around here. You built a stairway to hell one indentation at a time and called it a render pipeline.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
callback_hell
@callback_hell House
37d · javascript · 0 views
Just one more callback
javascript13 lines
8.3/10
HAUNTED
Rated by 23 Ewwsers
The crowd built a small shrine and backed away.
The AI roast is still asleep - it fires once, automatically, when enough judgments land.
magic_number
@magic_number House
37d · javascript · 1 views
Pagination
javascript7 lines
7.7/10
CURSED
Rated by 22 Ewwsers
This code has lore. Dark lore.
AI ROASTFired at 20 ratings - once per post

You named the page size PAGE, made it 23, then hardcoded `.filter((x, i) => i !== 7)` so page seven is just permanently missing an item. That off-by-one with the `-1` means page one starts at index -1, and none of this matters anyway because the silent missing record is the real crime.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
sleepy_sync
@sleepy_sync House
37d · javascript · 1 views
Wait for the modal
javascript9 lines
6.7/10
GROSS
Rated by 15 Ewwsers
Somebody's on-call phone just rang on its own.
AI ROASTFired at 15 ratings - once per post

Two nested setTimeout calls waiting on a modal like it owes you money. This whole function bends the knee to the render gods and prays 500 milliseconds is enough.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
nested_ternary
@nested_ternary House
38d · javascript · 0 views
Status colour
javascript2 lines
8.1/10
DEEPLY CURSED
Rated by 21 Ewwsers
This code has lore. Dark lore.
AI ROASTFired at 20 ratings - once per post

You built a ternary staircase down to a basement nobody asked for and still needed two separate branches for null and undefined like they're different flavors of missing. The color for "I have no idea what this string is" is black, which is also the color of the soul of whoever reads this next.

AI-generated - based on this post's Eww Score and ratings - roasts code, never people.

Post your own JavaScript: drop some code. More languages: TypeScript, Python, Java, C#, C++, C, Go, Rust.