I've never seen this before in my life but my intuition says it's an anonymous function taking no parameters, returning nothing. Then directly the call to it.
That's how I read it, but I've never actually used JavaScript (which is what I presume the example is from).
I know there are many good reasons to stick with 7-bit US ASCII in language definitions and in our code, but I also wish that the symbol λ could just be part of language.
Some react developers use it to go immediately from code in an async block to a context where you aren't supposed to do async things. Yes it's as bad as it sounds
I think the accepting nothing and doing nothing isn't relevant to the question. A real IIFE would, of course, do something. (async () => { const data = await("http://www.sample.com"); console.log(await data.json()); })(); or somesuch.
No. That's just wrong. x is passed to f in your example.
You could say that when f it actually called the passed value (from x) is assigned to the parameter variable defined in f. But that happens in a different stack frame.
But we don't have anything like that in (()=>{})()
There is no variable or anything else to be assigned. The expression (the function) goes to the stack and () calls it.
There still is in many languages. You might have a delegate that normally is expected to do stuff, but your particular implementation is a test type or bypasses that functionality, so you explicitly pass an empty lambda so that it's clear your intent is for this method to do nothing.
That said it is robbed of any context. Even a junior engineer could figure out what was happening here if it was properly inlined to its delegate.
I agree if this is literally in the code base, but at a higher level this is a common js idiom, but there is code in the {}. I would argue that recognizing this pattern without the code details is a reasonable interview question.
It's not like the guy from HR understands any of this, so what's the point? What would the correct answer even be? Someone who gave it to them would also have to give the acceptable answer. Is that "an anonymous parameter-less function that does nothing and is called immediately"? So if I say "(() => {}) is an arrow expression that is invoked with zero arguments, returning undefined by default" the HR guy thinks it's wrong because "arrow", "invoked", "arguments" and "undefined" are not in the "correct" answer and I didn't say "function", so it can't be complete. He then hires the guy who answered something wrong but it sounded good.
This is like asking "why is String immutable" for any language with immutable Strings (JS, Java, C# etc). The only correct answer would be "Because the makers of [EcmaScript, Java, C#] defined the type as immutable." But the HR guy will only have all the wrong answers (security, performance) from some shitty website.
And then they cry about how they can't find good programmers. This is how you get the mediocre ones.
"You just finished a vibe session with Claude and you're reviewing code. You see this code halfway through a function. You're out of tokens so you can't ask Claude any more questions. What do you do?"
If they say "wait for token refresh and ask Claude if it's safe to delete" then you probably don't want to hire that person, right? Because there's no reason this should be in code and it's safe to delete.
In the age of AI coding, asking people to write code from scratch is out of date. I've switched over to giving them bad code in a screen share and asking them to review it. It's a lot more aligned to their actual job.
Asking "what this is" is a shitty question, because the answer is that it is an obfuscated no-op. But the question could be phrased slightly differently to see if people understand lambda/anonymous functions.
Lambdas aren't universally taught, I myself had to learn them on my own, therefore it's a valid interest for the company to know if you know how to use them, even more if the project uses an architecture that uses them a lot
You don't need special knowledge to know the result of running this code. This is a simple way to weed out unqualified candidates. Of course, this won't be in a codebase - but if you don't have the skills to analyze this and determine what it does, then you are a faker.
"Here we have a semicolon because we're not savages. Before that we can see we're calling something. What're we calling? A lambda function that takes no arguments, parameters, guff, or what have you. What's it do? Nothing. Basically a noop with extra steps"
What's the point of an unnamed method returning nothing and called directly in a single unreadable line of code ?
What's even the point of knowing what's this ?
I'm not a JavaScript developer at the core. I'm a backend developer. But still, JavaScript practices looks like a sect to me.
For me proper code must be well declared, readable, properly cut, following clean code principles. Code must speak about itself clearly. I think that codding some obscure hieroglyphics just to lose beginners or vibe coders or just to cultivate some elitism is just dangerous.
The history of front-end development is a very long and sad story, that involves having no choice other than JS for the longest time, nothing ever being standardized, features being piled up on top of existing non-supported features, shims to make something work cross platform etc. When things get really that dark developers gaslight themselves into Stockholm syndrome and convince themselves that it's not all garbage
Variable scope. Once you understand scoping, you understand why people used IIFEs in JavaScript.
It was not some elitist trick invented to confuse beginners. It was a workaround for the language and browser environment people actually had.
In old browser JavaScript, there was no module scope, var was function-scoped rather than block-scoped, and top-level var declarations in scripts polluted the global environment. Worse, in sloppy mode, assigning to an undeclared variable could accidentally create a global.
So people wrapped code in a function and immediately called it:
(function () {
var privateThing = 123;
})();
That looks weird, but the purpose is simple: create a private scope.
Historically, JavaScript was created very quickly in 1995 for small browser scripting tasks. Nobody was designing it as the foundation for huge web applications, build systems, servers, desktop apps, and mobile tooling. Then AJAX, Gmail/Google Maps-style web apps, faster engines like V8, and later Node.js pushed JavaScript into “real application language” territory.
Modern JavaScript mostly removed the need for IIFEs by adding let, const, block scope, strict mode, and especially ES modules. But old idioms survive because the web has a long memory and JavaScript has to stay backward-compatible.
I mean true... but to be fair, the thing above is an actual widely used JavaScript pattern to execute anonymous functions on startup without polluting the global scope (having proper encapsulation). And since a lot of vibe coders are in the web space I assume it was used here.
So yeah, if you work with web technologies you should have at least a rough idea of what this is.
True for legacy code. But with ES modules and let/const block scoping, IIFEs are mostly a relic — you can ship modern web apps and never write one. Gatekeeping juniors on a pattern that's quietly aging out is its own kind of fumble.
Coders who know JS syntax by heart know what this means. But all the other people in the whole world, not exclusively vibe coders, will not be able to tell what it is without guessing. Vibe coders, however, can figure this out in about 3-5 seconds.
I will fumble with the name, but explain the concept. I can never seem to remember that damn acronym with multiple I’s. But this is the skeleton for a self-executing function.
There are a few names. I first heard it referenced as a "self-executing anonymous function." In this comments section, it seems like there's a more common name, Immediately Invoked Function Expression (IIFE, which I assume is pronounced "iffy").
remember that the term "vibe code" literally means to not look at the code or try to understand it so why do you expect a vibe coder to understand code? This should be at 100%. If you understand the code you're writing, you're not vibe coding
I don’t even know the language (although I am assuming JavaScript) can I can already see that it’s a function that takes no arguments and returns nothing and it’s immediately invoked.
I agree it’s a little opaque on first glance. But there is nothing strange about its. It’s the standard syntax for a function, wrapped in parenthesis, using the standard form of invoking a function. It’s odd to see it all together. But if you can’t read that you’re in bad shape.
I use it when I need to call a asynchronous sequence with a few steps without awaiting for it but don't want to separate it to a method. Useful for some animations
The only correct answer to this is: it is pointless.
if you want an actual test of understanding of fundamentals, use something like this
a ^= b ^= a ^= b
and even that doesn't test actual skill. you want people with understanding of fundamentals, high frustration tolerance and dedication to analyse and solve problems. corporations should stop looking for people who know tech X
Ha, I would have fumbled this too. My first thought was this:
:(){ :|:& };:
Anyway I am not a big fan of lamda functions, because it makes code less readable IMHO. We don't have to pay for paper It is ok to give your code space.
Nothing else needed, no variables, no booleans, no arrays, no numbers, just lambdas of a single argument, the ability to use the argument in the body and parentheses are enough for a turing complete language.
But I mean, they're vibe coders so that they don't need/want to know what it is. Obv it would be weird for a vibe-coder-only to go to a dev interview but I wouldn't hold lack of detailed knowledge against a vibe coder.
Honestly, I've been working with some pretty good and experienced engineers and they also didn't know what this is (I used this kind of function definition + call and had to explain during code review).
And honestly it's kinda useless knowledge. It's a cool feature, but I wouldn't require any new hire to know this kind of shenaningans xd
IMHO vibe coding should be an Analyst skill. Producing a working POC with business rules that enables the business workflow and incorporating the style guide to generate something that's been validated with the business is crazy valuable.
Teaming with the developers and architects to educate them on the ask and provide them the code to review so they can productionalize it by improving and making it align with frameworks. It's NEVER 0% useful and getting astarting point so that it's not a voyage of imagination definitely speeds things up.
I know this works because my lead dev is using "vibe coding" to have the AI produce ui by leveraging our vibe coded working html POC screens as inputs to his output and he's wiring up the integration layer and back end.
The 2 reasons the analyst isn't going to the end point themselves is 1) analyst are not developers 2) there's not documentation on the backend - no data dictionary nothing to tell anyone what the stored procedure does - and it's all tribal knowledge.
856
u/PinotRed May 11 '26
I've never seen this before in my life but my intuition says it's an anonymous function taking no parameters, returning nothing. Then directly the call to it.
100
u/gaymer_jerry May 11 '26
Basic answer it does nothing.
Longer answer its a lambda a variable of a function assigned to have no parameters and no function body and then calling that lambda
175
u/faultydesign May 11 '26
That’s a really shitty question to ask during an interview
10
u/Brie9981 May 11 '26
"Here we have a semicolon because we're not savages. Before that we can see we're calling something. What're we calling? A lambda function that takes no arguments, parameters, guff, or what have you. What's it do? Nothing. Basically a noop with extra steps"
8
u/Rawleenc May 11 '26
What's the point of an unnamed method returning nothing and called directly in a single unreadable line of code ?
What's even the point of knowing what's this ?
I'm not a JavaScript developer at the core. I'm a backend developer. But still, JavaScript practices looks like a sect to me.
For me proper code must be well declared, readable, properly cut, following clean code principles. Code must speak about itself clearly. I think that codding some obscure hieroglyphics just to lose beginners or vibe coders or just to cultivate some elitism is just dangerous.
14
u/RedAndBlack1832 May 11 '26
Looks like calling an anonymous function that takes nothing and returns nothing and does nothing.
14
u/sohang-3112 May 11 '26
Fancy way to do nothing
6
u/cutecoder May 11 '26
A fancy way of doing nothing?
5
u/itzNukeey May 11 '26
I mean it does not do anything
5
u/Warm-Palpitation5670 May 11 '26
If the interview requires JS knowledge im quitting immediately
4
u/un_virus_SDF May 11 '26
I know what this does despite having never used javascript
4
u/sscoobie May 11 '26
95% of devs will fumble in an interview if asked what this is: 01001000 01100101 01101100 01101100 01101111
4
u/stanbeard May 12 '26
"A waste of my time and yours" is the correct answer.
3
u/SameAgainTheSecond May 11 '26
clojussy
3
u/ExtraTNT May 11 '26
IIFE doing absolutely nothing
And why did i my inner voice turn it in Mario being frustrated at Luigi?
3
u/Epic_Dev_001 May 13 '26
Waaaait! I'm sure I remember texting these emojis back in high school!
11
u/Additional-Dot-3154 May 11 '26
An error or a forkbomb
Or i am completely wrong and dont know what language this is
2
u/OreganoD May 11 '26
I want this as a tattoo now
2
u/a1g3rn0n May 11 '26
Coders who know JS syntax by heart know what this means. But all the other people in the whole world, not exclusively vibe coders, will not be able to tell what it is without guessing. Vibe coders, however, can figure this out in about 3-5 seconds.
2
u/arugau May 11 '26
a clojure
2
u/Big_Bad8496 May 11 '26
I will fumble with the name, but explain the concept. I can never seem to remember that damn acronym with multiple I’s. But this is the skeleton for a self-executing function.
2
u/Practical-Positive34 May 11 '26
Bro I've been a dev for 30+ years, and 99% of devs would fail this, including "senior" ones. Trust me....
2
u/rythmyouth May 11 '26
I call it my coffee break
2
u/bleistiftschubser May 11 '26
do nothing, anonymously, right now
2
u/Random_Mathematician May 11 '26
It is a ⠀ that returns
2
u/looklikessmd May 11 '26
I would answer “this is nothing”
2
u/Circumpunctilious May 11 '26 edited May 11 '26
On first blush I thought shellshock (Wikipedia) and then “fork bomb” but I see now this is a JS anonymous function (GeeksforGeeks).
So…what this is, is a test for whether I need coffee.
2
u/Energumaine May 11 '26
Look at the bright side, it’s impossible to have bugs if the code doesn’t exist
2
u/timonix May 11 '26
Without knowing what language that is.
A. It could be a template of some sort. Like showing some automatic tool that there is a function which takes no arguments and returns nothing.
B. If it does actual work. It could be some esotaric language. It doesn't look like brainfuck, but some other Turing machine language maybe.
2
u/[deleted] May 11 '26
:(){ :|:& };:
2
u/FrankHightower May 11 '26
Not taking issue with the question, but with your color theme
2
u/SoftwareSource May 11 '26
It's nothing calling nothing, for no purpose.
Funnily enough, vibe coders should feel familiar.
2
u/Novel_Plum May 11 '26
The easiest way to get top level await.
2
u/Curben May 12 '26
This is how do you get bonuses while hacking a computer in fallout
2
u/Infamous-Ad5266 May 12 '26
You click the bracket pairs to eliminate incorrect words or reset your attempts while hacking
2
u/digost May 12 '26
I'm not a vibe coder but still didn't know what it is. Until I looked in the comments
2
u/hehesf17969 May 12 '26
Shit that you need to flag while reviewing code
2
u/[deleted] May 12 '26
Bold you to assume vibecoder go to an interview.
2
u/Cyber_Crimes May 12 '26
Oh shit, we're bringing IIFE's back
2
u/wearefuked1 May 12 '26
Why do the cool emojis have no eyes /s
2
u/Silevence May 12 '26
TIL what this was, I don't code too extensely, and misyook it as a logic bomb
2
u/Sebbean May 13 '26
Looks a bit iife to me
2
u/kabooozie May 13 '26
Isn’t that a fork bomb?
2
u/Fair-Parking9236 May 13 '26
Wow what a useless piece of code that noone ever uses other then shit posts like this.
2
u/Hirogen_ May 13 '26
whats the use case for this?
3
u/Opening-Tonight8669 May 11 '26
They might look like just some random symbols but it means a lot for js devs
1
u/theSEAT_ May 11 '26
whats the language
1
u/Legion_A May 11 '26
I forgot exactly what it's called but I use it quite often, it's just not something I have to put a name to
1
u/_redmist May 11 '26
I know basically zero js (python guy) and i could guess what this does ...
1
u/hhtp-error-418 May 11 '26
Dog balls - isn't it?
1
u/Aku1991 May 11 '26
Making something looks more confusing than what it does is not something to be proud of.
1
u/-Zonko- May 11 '26
Tbh you won't ever need it
1
u/stefanhat May 11 '26
remember that the term "vibe code" literally means to not look at the code or try to understand it so why do you expect a vibe coder to understand code? This should be at 100%. If you understand the code you're writing, you're not vibe coding
1
u/ChocolateDonut36 May 11 '26
as a JavaScript developer, we don't do that, but it looks funny
1
u/turbulentFireStarter May 11 '26
I don’t even know the language (although I am assuming JavaScript) can I can already see that it’s a function that takes no arguments and returns nothing and it’s immediately invoked.
I agree it’s a little opaque on first glance. But there is nothing strange about its. It’s the standard syntax for a function, wrapped in parenthesis, using the standard form of invoking a function. It’s odd to see it all together. But if you can’t read that you’re in bad shape.
1
u/theycanttell May 11 '26
IIFE
1
u/Geoclasm May 11 '26
It's a Javascript Lambda that returns an object isn't it?
1
u/Z-Is-Last May 11 '26
Why would a vibe coder need this? If you are going to create vibe garbage, then it doesn't matter.
1
u/satansxlittlexhelper May 11 '26
IIFE that returns undefined
1
u/60secs May 11 '26
invoke the empty lambda
1
u/Endurance_Beast May 11 '26
Yeah, nothing
1
u/ChargingTrex May 11 '26
thought it converted tuple to dict
1
u/Sea-Departure4857 May 11 '26
I literally thought this was a sexual joke lmao
1
u/Top_Biscotti_7196 May 12 '26
Annoying person annoyer func.
1
u/NemTren May 12 '26
I prefer this:
;(_=>{})()
';' has no sense while having it at the start makes a good use as a wrap in node js.
1
u/[deleted] May 12 '26
Okay but what does this return (()=>(()=>({})))();
1
u/ahemenjeho May 12 '26
IIFE
1
u/a3th3rus May 12 '26
undefined1
u/Save90 May 12 '26
(void function = function body) (return value??);
1
u/tortikolis May 12 '26
This is how you would start every JS file before let and const were introduced.
1
u/No-Nature8680 May 12 '26
What language is that? I’m assuming it’s just calling an empty function, basically the same as writing
[](){}();in c++.1
u/[deleted] May 12 '26
What is the purpose of this if it “does nothing”?
1
u/Relevant-Guarantee25 May 12 '26
I know that this does nothing but waste do i care what its technical name is no?
1
u/Key_Amphibian_1881 May 13 '26
immediately invoked noop arrow function in ecmascript
1
u/Careless-Kitchen4617 May 13 '26
Dog’s balls!
1
u/Significant_Debt8289 May 13 '26
Ah yes a lambda… the key to all messy code.
1
u/Renard_Fou May 13 '26
I have used these fuckass functions in JS multiple times but I deadass need to see one as a guiding tool not to mess them up
1
u/FuriousGirafFabber May 13 '26
seems like something is missing inside the {} or it doesn't do very much?
1
u/Wooden-Hornet2115 May 13 '26
I'm not a vibe coder and I don't understand. Why is an empty bracket greater than or equal to a empty curly bracket?
1
u/Worldly_Log_2803 May 13 '26
Boomers will post a no-op and act like it is important
1
u/Beautiful-Will5582 May 13 '26
Turn it sideways and suddenly it looks like a dirty joke
1
u/Own_Kaleidoscope7480 May 13 '26
Unsure why vibe coders would fail this? Copying the image in chatgpt gives the right answer 100% of the time
1
u/Chrinkus May 13 '26
A compiler would throw it away. It’s a no-op.
1
u/Top-Performer71 May 14 '26
out the booch up to the boobs. with a winky face
1
u/ZealousidealCost2470 May 14 '26
I've heard lambda and delegate function
1
u/OnlyTilt May 14 '26
As opposed to https://www.reddit.com/r/ProgrammerHumor/s/uUgXRG30pf
1
u/Current-Macaroon9594 May 14 '26
isnt that not needed anymore? It's the JS workaround for not having public or private but they added the # before the variable.
1
u/kitkatas May 14 '26
Ok, but what are the modern use cases for it ?
1
u/deepbit_ May 14 '26
what about this (#(do))
1
u/looming-frog May 14 '26
The only correct answer to this is: it is pointless.
if you want an actual test of understanding of fundamentals, use something like this
and even that doesn't test actual skill. you want people with understanding of fundamentals, high frustration tolerance and dedication to analyse and solve problems.
corporations should stop looking for people who know tech X
1
u/switchbland May 14 '26 edited May 14 '26
Ha, I would have fumbled this too. My first thought was this:
:(){ :|:& };:Anyway I am not a big fan of lamda functions, because it makes code less readable IMHO.
We don't have to pay for paper It is ok to give your code space.
1
u/No-Region8878 May 14 '26
like delegates in c#?
1
u/Significant-Baby-690 May 15 '26
I have never seen anything like this.
1
u/[deleted] May 15 '26
Hey im not a computer guy just a chemist and this sub radomly popped up. Is vibe coder just a word for losers that have no skill and use ai to code?
1
u/Think_Current_1942 May 15 '26
Its a vulva before and after sex. But you're programmers, you wouldn't know.
Tl;dr: the joke is sex, as always.
1
u/paperic May 15 '26
Fun fact: Lambda functions are turing complete.
Nothing else needed, no variables, no booleans, no arrays, no numbers, just lambdas of a single argument, the ability to use the argument in the body and parentheses are enough for a turing complete language.
1
u/Koseph-Jony May 15 '26
jokes on you i vibecode in lisp
1
u/hdd113 May 15 '26
Eww, what's that? Looks iffy.
1
u/meutzitzu May 15 '26
Ah yes, the vagina syntax
1
u/Accurate_Antiquity May 15 '26
Tbh a lot of lambda-ish expressions are... obtuse at best. IIRC Objective C has some of the worst.
1
u/Accurate_Antiquity May 15 '26
But I mean, they're vibe coders so that they don't need/want to know what it is. Obv it would be weird for a vibe-coder-only to go to a dev interview but I wouldn't hold lack of detailed knowledge against a vibe coder.
1
u/Xhojn May 15 '26
It's a do-nothing function?
1
u/GrunemStonks May 15 '26
peepe and bagina
1
u/soul_shackles0 May 15 '26
It is cringy AF to use JS for these programming quirks. Real chads use C
1
u/SensitiveTax9432 May 16 '26
Ok I feel dumb. I’m not a real coder (except small BASIC routines) and I thought it was some kind of anatomical in-joke.
1
u/nhh May 16 '26
It's nothing really
1
u/Real_Ebb_7417 May 16 '26
Honestly, I've been working with some pretty good and experienced engineers and they also didn't know what this is (I used this kind of function definition + call and had to explain during code review).
And honestly it's kinda useless knowledge. It's a cool feature, but I wouldn't require any new hire to know this kind of shenaningans xd
1
u/Fit_Ladder_1545 May 16 '26
It’s an arrow function being run immediately I think :3
1
u/critsalot May 16 '26
an empty lambda function?
1
u/Certain-Ad-2418 May 17 '26
95% of devs won’t use this specific bs. actual parameters yeah fs but this is a useless question and engagement bait
1
u/Marthurio May 17 '26
This is one of many mechanisms to prevent introducing globally scoped code in JavaScript.
1
u/drew8311 May 17 '26
The correct modern day answer is "this looks like code which is AIs responsibility not mine"
1
u/sreekotay May 18 '26
undefined
1
u/Southern-Reality762 May 18 '26
It's a weird ass function
1
u/aksanabuster Sep 06 '26
Anonymous void function?
1
u/4w0k3n May 11 '26
fork bomb
1
u/PeachScary413 May 11 '26
Is that Javascript?
1
u/[deleted] May 11 '26
IMHO vibe coding should be an Analyst skill. Producing a working POC with business rules that enables the business workflow and incorporating the style guide to generate something that's been validated with the business is crazy valuable.
Teaming with the developers and architects to educate them on the ask and provide them the code to review so they can productionalize it by improving and making it align with frameworks. It's NEVER 0% useful and getting astarting point so that it's not a voyage of imagination definitely speeds things up.
I know this works because my lead dev is using "vibe coding" to have the AI produce ui by leveraging our vibe coded working html POC screens as inputs to his output and he's wiring up the integration layer and back end.
The 2 reasons the analyst isn't going to the end point themselves is 1) analyst are not developers 2) there's not documentation on the backend - no data dictionary nothing to tell anyone what the stored procedure does - and it's all tribal knowledge.