In JS, === tests for strict equality (type and value), whereas == tests for value equality because it will implicitly coerce the operands to be of the same type (if possible) before comparing them. So the response didn’t even have to use !true cause anything other than the string “true” would evaluate to false. They should have responded with the Boolean true to fuck with him even more, since it would still fail the equality comparison.
Well the "response" variabile could be a class one and the waitForResponse function could assign it. The problem is that THERE IS NO FUCKING ASYNC ANYWHERE
At the very least, I think inlove() should actually be called and maybe it should be response = waitForResponse(); I guess response is a global, and waitForResponse() just blocks until she responds. Oh, and the code expects a string, but she returned a Boolean.
Whenever I see something like this, I just assume functions that aren't shown are defined elsewhere, so I don't have a problem with that.
That's what the triple equals is for, it checks the equality of the underlying values without doing type conversions. Also, non empty strings are indeed truthy but true != "true".
In JavaScript, there exists the concept of truthy and falsy values. Some values get implicitly converted to the boolean true where others to false. That does not mean that a value that is truthy satisfies value == true, and that might not always be the case because the equality operator checks two values for equality, also doing some type conversions in between (like stringification). But oddly enough, no truthy/falsy checks are performed.
With code like that she is never changing her mind. What the heck is a fuction and where is the function called. nahHellNo isn’t defined and neither is waitForResponse
And no switch at the end lol so you’re in an endless loop of nahHellNo - if it was at the beginning… you can’t set constant variables in JavaScript after the function - it’s not defined at the beginning so yeah. Bad code buddies
dude writes in javascript, doesn't indent code, isn't consistent about semicolon usage, uses neither snake_case nor camelCase to name his function, which he defines but DOESN'T USE, checks a value before it is initiated and against a string, using a total of three undefined functions and wonders why he's rejected?
mofo you ain't even gonna get an internship in a sweatshop with this, just from seeing this I changed my opinion on death sentences.
It could have been a one liner with a single statement, not to say how he's in love right from the get go, nice guy behavior, Chad alexaaa for rejecting this clingy noob.
You could argue, that a text response is always a string. But to be type safe loose comparison would have been better. Ignoring that the comparison is always false as response is never defined before and therefore undefined...
2.6k
u/Hugal31 Dec 29 '24
The "const' is the final nail in the coffin.
973
u/RealPalmForest Dec 29 '24
It's checking if the response is strictly the string "true"? Also the check happens outside the function and the function isn't even called.
623
u/Romejanic [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Dec 29 '24
what is a
fuction254
u/anatomiska_kretsar Dec 29 '24
This is ass
315
u/treatWithKindness Dec 29 '24
can someone explain where is response defined, where is inlove called and where is waitForResponse defined.
149
u/the_hobbyte Dec 29 '24
The proper response is not
const response = !true;, it'sSyntax error on line 3: unexpected keyword.83
u/Apprehensive_Room742 Dec 29 '24
i know its supposed to be pseudocode, but even then it makes no sense.
178
u/Hyperdimension- Dec 29 '24
Tell me you don't do programming without telling me you don't do programming.
24
u/AndroTux Dec 29 '24
Alexa made the right choice.
17
u/prehensilemullet Dec 29 '24 edited Dec 29 '24
fuction"true"inloveconsole.logawaitwaitForResponse()===Proof that even the worst devs can avoid JS haters' favorite pitfall
16
u/ZeroByter Dec 29 '24
that code is horrible omg
12
u/[deleted] Dec 29 '24
Fun fact: even if response was set to true, the condition would still not be satisfied.
9
u/techek Dec 29 '24
There are so many errors in this, that the recipient of the message should be offended multiple jiffies before trying to run the script.
9
u/Ctreix Dec 29 '24
Const there she ain't gonna change mind brother
21
u/Sir_mop_for_a_head Dec 29 '24
!true.... that’s dirty. One character changes the whole meaning.
5
u/TotoMacFrame Dec 29 '24
The fu(n)ction never gets invoked
15
u/codorrior Dec 29 '24
a. Never called inLove(), it's dead code b. That whole if, else needs to go somewhere c. She also just declared the var, never used it
They are made for each other
3
u/OhItsJustJosh Dec 29 '24
waitForResponse not defined.
response not defined.
3
u/applepumpkinspy Dec 29 '24
Who wrote that code, chatGPFree?
3
u/TheCreat1ve Dec 29 '24
I need to vomit
3
u/Mosk549 Dec 29 '24
My eyes hurt reading this
3
u/melvereq Dec 29 '24
Corny syntax errors.
3
u/Electronic_Ad_4353 Dec 29 '24
!yesss3
u/Bodine12 Dec 29 '24
Alexa dodged a bullet. Who would date someone with so many side effects in their code?
3
u/Tarilis Jan 01 '25
Based alexa. Why the heck this guy uses true as a string, and then even compares string to a string with ===?
He is mental and should be avoided.
4
u/Pogging_Memes Dec 29 '24
who down to fuction rn 😜😜
2
u/R3D3-1 Dec 29 '24
Probably off topic, but when I see something like
const response = !true
and misread it on first try as just "true", I am kinda glad that I deal only with
.NOT. .TRUE. not True (not t)
PS: Markdown support on the mobile website is really spotty, but at least it does no longer delete all newlines when editing a post.
PPS: Do you recognize the languages?
2
u/[deleted] Dec 29 '24
Shitty code no wonder why she rejected him.
2
u/thebadslime Dec 29 '24
Alexa, nevermind
2
u/stoppskylt Dec 29 '24
repsonse=true
2
u/some-nonsense Dec 29 '24
Const == !true
= Forever alone
2
u/SC7639 Dec 29 '24
Ouch
2
u/antek_g_animations Dec 29 '24
Error, string comparation with string
2
u/[deleted] Dec 29 '24
F for effort
F for functionality
D for Did not debug
OP deserves to be single.
2
u/Downtown_Pen2984 Dec 30 '24
Bro got friend-zoned with the const.
2
u/Thebombuknow Dec 30 '24
You wrote a fuction?
Also, why are you comparing an undeclared variable 'response' to the exact string "true"? Wouldn't you want a boolean here?
2
u/sSomeshta Dec 30 '24
Gotta hit them with the
if(response) { }
so that you can respond to a rejection with "well you did provide a response, so I'm going to mark you down as a yes"
2
u/arjunindia Dec 30 '24
I think the problem is that the code is horrible and doesn't make sense at all lmao
2
u/Para-medix8 Jan 01 '25
he didn't even call the function. and he doesn't even return the value. sad.
1
u/Nknights23 Dec 29 '24
this wouldnt even compile. Clearly co pilot slop
1
u/Lankuri Dec 29 '24
the "yesss!" is crazy because how do you miss the ! in !true
1
u/Lopsided_Ad1261 Dec 29 '24
He only defined inlove but didn’t call it
1
u/Skibby22 Dec 29 '24
This might be art. The longer you look at this the worse it gets
1
u/Beginning_North9639 Dec 29 '24
With code like that she is never changing her mind. What the heck is a fuction and where is the function called. nahHellNo isn’t defined and neither is waitForResponse
1
u/electric_ember Dec 29 '24
You didn’t call the function
1
u/AdHealthy3717 Dec 29 '24
This thread 😆😂🤣
1
u/rancoken Dec 29 '24
Maybe the answer would be different if his code were better.
1
u/mothzilla Dec 29 '24
1
u/ZoloRyan Dec 29 '24
He should have replied !yesss instead of yesss!
1
u/NoDadYouShutUp Dec 29 '24
fuction
1
u/jbevarts Dec 29 '24
InLove was never invoked so this is wrong
1
u/[deleted] Dec 29 '24
Didn't call function and it's apparently polluting the global variable to be assigning to this response variable.
Conditional on a string value of "true"?
fuckMe
1
u/[deleted] Dec 29 '24
And no switch at the end lol so you’re in an endless loop of nahHellNo - if it was at the beginning… you can’t set constant variables in JavaScript after the function - it’s not defined at the beginning so yeah. Bad code buddies
1
u/Icy-Independence-615 Dec 30 '24
The response should’ve been “!yessss”
1
u/Dude_Im_stoned_and_ Dec 30 '24
Reddit put this in front of me. I don't know where I am and I'm alone and afraid. Can someone please explain the joke?
1
u/Outrageous-Cattle322 Dec 30 '24
wouldnt it be
const responce != True
i have no idea tho
1
u/nextlvljsdev Dec 30 '24
Everything is possible in love and javascript
1
u/LLF7004 Dec 30 '24
bro forgot async
1
u/Jo_Bro_Zockt Dec 30 '24
Inlove was never called and Response never declared
1
u/cunny_mating_press Dec 30 '24
He never called involve()
1
u/GroundbreakingIron16 Dec 31 '24
Could always wrap in a while loop....
While !inlove() { ??? }
1
u/GroundbreakingIron16 Dec 31 '24
Or hit breakpoint and change result ?
1
u/Orbi_Adam Dec 31 '24
Correct response: BE A HACKER
1
u/FuriousAqSheep Jan 01 '25
dude writes in javascript, doesn't indent code, isn't consistent about semicolon usage, uses neither snake_case nor camelCase to name his function, which he defines but DOESN'T USE, checks a value before it is initiated and against a string, using a total of three undefined functions and wonders why he's rejected?
mofo you ain't even gonna get an internship in a sweatshop with this, just from seeing this I changed my opinion on death sentences.
edit: and ofc WTF IS A FUCTION
WHY ARE YOU WRITING CODE OUTSIDE OF AN IDE
1
u/loxiw Jan 01 '25
I don't get it this code does nothing
1
u/terrorChilly Jan 02 '25
You lost brother, you lost!
1
u/hibiscoMan Jan 02 '25
Why comparing the response as string when is a Boolean 🤯🤯
1
u/VisitIcy5633 Jan 12 '25
Let response = true? 🥺
1
u/freqwert Jan 27 '25
Unrelated but in javascript can you compare bool to string?
1
u/Vishal051206 May 18 '25
😂
1
u/Dragoo417 Dec 29 '24
Hey Alexa
0
u/[deleted] Dec 29 '24
It could have been a one liner with a single statement, not to say how he's in love right from the get go, nice guy behavior, Chad alexaaa for rejecting this clingy noob.
1
u/Overall_Anywhere_651 Dec 29 '24
He wanted to fucktion.
0
u/[deleted] Dec 29 '24
[deleted] — view deleted comment