TechEarl

70 JavaScript Jokes Every JS Developer Has Lived

Seventy JavaScript jokes about typeof null, the event loop, npm install, callback hell, hoisting, and the framework that shipped while you read this sentence.

Ishan Karunaratne⏱️ 2 min readUpdated
Share thisCopied

70 JavaScript Jokes

I asked JavaScript what type null was. It said object. I stopped asking questions.

NaN is not equal to NaN. That is the only thing in JavaScript that knows itself.

I used == once. The linter is still in therapy.

Hoisting is when your variable shows up before you do.

I ran npm install on a Monday. By Friday it finished, and three of the packages were already deprecated.

My node_modules folder has its own gravitational pull. Light bends around it.

The error said Cannot read properties of undefined. I cannot read properties of my life either, JavaScript. We are the same.

undefined is not a function. And yet, here we are, calling it.

I learned a new framework on Monday. On Tuesday it was legacy.

Callback hell is when your code starts looking like a staircase to nowhere.

Then async/await arrived. Now my code looks normal and fails silently.

Promise.all is a great way to fail eight things at once.

I tried to sort an array of numbers. [1, 2, 10, 20] became [1, 10, 2, 20]. JavaScript sorts numbers like a four year old reads a phone book.

this in JavaScript depends on the weather, the position of the moon, and whether you used an arrow function.

Arrow functions fixed this. They also broke this, in different code, in ways you will discover later.

I asked a junior what the prototype chain was. He said it was a bike lock. I did not correct him. He will figure it out at 2am like the rest of us.

JavaScript has block scope, function scope, and one more scope nobody talks about: the scope of regret.

I added a Date object to my code. Now it is January 1970 and I am eight months old.

Date math in JavaScript is what happens when nobody on the original team owned a calendar.

I ran into a package called left-pad once. It was eleven lines of code. Half the internet went down when its author left.

There is a JavaScript framework released every Tuesday. The other days are for arguing about it on Twitter.

I picked Webpack in 2017. I picked Vite in 2022. I am picking again next year. I have not shipped a feature since 2016.

Babel transpiles your modern JavaScript so that one user on Internet Explorer can still hate your site.

ES6 came out and we all rewrote everything. Then ES2017, ES2020, ES2022. The rewrite is the deliverable now.

jQuery is dead. It still ships on more sites than React. Death suits it.

I deleted node_modules and ran npm install again. It is the JavaScript version of turning it off and on. It works about as often.

package-lock.json has merge conflicts on every pull request. Nobody reads them. We just accept incoming and pray.

I once read the entire package-lock.json file. My will is being contested.

JavaScript Object Notation was invented by someone who thought, what if we made JavaScript portable, but with even fewer features.

JSON does not support comments. This was a feature, apparently. The reasoning has not aged well.

The event loop is the only thing in JavaScript that actually does its job on time.

setTimeout(fn, 0) is not zero. It is whenever the event loop feels like it. JavaScript runs on island time.

Closures are simple. A function that remembers things. Like an ex with your Netflix password.

I declared a variable with var inside a loop. It escaped. It is roaming the scope. I cannot find it.

JavaScript fatigue is when you read a tutorial that mentions four tools you have never heard of, and one of them replaces the tool you learned last month.

TypeScript is JavaScript with feelings. Mostly the feeling that you should have used TypeScript from the start.

I added strict mode to a legacy file. The build took six hours and one of the founders cried.

I tried to compare two objects with ===. JavaScript said no. They are different objects. They are identical. They are different. Welcome.

[] + [] is an empty string. [] + {} is [object Object]. {} + [] is 0. The language is held together by hope.

I have been writing JavaScript for 25 years. I still google how to copy an array. The answer changes every two years.

I used JSON.parse(JSON.stringify(x)) to deep clone an object. It worked. The Date became a string, the function vanished, the undefined keys left. Otherwise, identical.

I wrote a destructuring line so dense the reviewer asked if it was a regex. It was assigning three variables.

for...in iterates keys. for...of iterates values. The one you picked is always the other one.

I spread an array into another array, into another array, into another array. The linter shrugged. The bundle did not.

parseInt without a radix is a coin flip dressed as a function.

I hit Number.MAX_SAFE_INTEGER in production. The id became approximately the id. The user became approximately the user.

BigInt and Number cannot be compared with strict equality. They also cannot be added. They live in the same house and refuse to speak.

I added optional chaining to one expression. Now every expression has it. The file looks like a question I never finished asking.

The ?. swallowed an error for six months. We found it the day before the demo. It had been eating money.

I wrote an async function and forgot to await it. The Promise sat in a corner, fulfilled, ignored, like a wedding gift from your aunt.

Promise.all rejects on the first failure. The other nine requests still ran. You paid for them. You will not see them.

ts-ignore is the prayer of a tired engineer. @ts-expect-error is the prayer of one who has learned shame.

TypeScript any is the trapdoor under the trapdoor. You meant to type it. You will. Next sprint.

I installed a library. Its .d.ts file described a different library, one I would have preferred.

ESLint says no semicolons. Prettier adds semicolons. The CI runs both. The branch is on fire and we are arguing about punctuation.

The import order plugin reordered my imports. The diff is 800 lines. The change is zero lines. The reviewer is upset.

I forgot a semicolon before a line starting with a bracket. ASI saw the bracket and assumed the previous line was a function call. The previous line was a return statement.

I wrote return on one line and {} on the next. The function returned undefined for three years. Nobody noticed because nobody read the return value.

fetch landed in Node 18. My code targeted Node 16. The polyfill targeted Node 14. The container targeted Node 20. The deploy targeted my weekend.

There is a deprecation warning in our logs from 2019. We scroll past it the way you scroll past a relative on a flight.

One dependency in our tree pins Node 14. We pinned the whole project to Node 14 to keep it happy. The project is also pinned to 2021.

I refactored a 4000 line module. Every console.log survived. They are the only thing that did.

use strict at the top of a file in 2026. It is a relic. Like a thank you note. Nobody asked for it. It is correct anyway.

I wrote an IIFE in front of a junior. She asked why the function was eating itself. I could not explain in a way that did not make her sad.

I found var in a 2024 codebase. It was load bearing. Removing it broke three pages. We left it there. It has earned its place.

Date.now() and new Date().getTime() return the same number. The codebase uses both. The team has split into factions. The standup is now diplomacy.

I set a setTimeout for 1000ms. It fired at 1003. I lost a test. I am writing this from the postmortem.

I called event.stopPropagation in the handler. The form submitted anyway. There were six handlers. I had stopped exactly one of them.

Defaulting with || worked until a user typed 0. Then I learned about ??. Then I learned about a different bug I had been hiding for two years.

Sparse arrays exist. I did not know this. The array had length 7 and three of the slots were holes. Not undefined. Holes. The shape of the missing thing.

Why JavaScript humor outlives every framework

Frameworks change quarterly. The jokes do not. typeof null still returns "object", NaN still refuses to equal itself, and npm install still feels like opening a portal. The language is the punchline, and the punchline has tenure.

See also

Sources

Authoritative references this article was fact-checked against.

TagsHumorJokesJavaScriptWeb DevelopmentFront-EndNode.jsnpmTech Humor

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Tech Architect · Software Engineer · AI/DevOps

Tech architect and software engineer with 20+ years building software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Currently Chief Technology Officer at a healthcare tech startup, which is where most of these field notes come from.

Keep reading

Related posts

55 Airport Jokes Every Traveler Has Lived

Fifty-five airport jokes about the security line, the boarding-group anxiety, the gate change at the far end of the concourse, the $14 sandwich, and the seat that does not recline.