How else could they avoid it? It’s a lambda not really an equal sign so unless the challenge was explicitly don’t use the ‘=‘ character as opposed to not assigning any variable that way. I see your point though...
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/Ailko, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
Reddit should make up its mind about whether this is supported or not. The ``` syntax is better for writing in almost any context; Only when you're supposed to read the markdown, does the indentation variant make sense, and on reddit, you're not.
Heck, when we're at it: Reddit mobile clients don't have monospaced fonts. So should we not use code blocks at all?
React Suspense does (or did, it was some time ago) a trick with catching promises of data thrown from components, i cant pinpoint a link to source but googling should lead you to info
a try/catch block means that if an error occurs in the try block, the program won't stop and the error will be sent to the catch block through the parameter. the throw statement is throwing an error, but the content of the throw can be anything we want which means that we can send over a value and capture it in a variable inside of the catch block without the use of assignment
Of you make your return types throwable in python or use python2 you can use raise as a way to return, and that may simplify return type checking/differentiation
205
u/Franks2000inchTV Apr 29 '21
But... It... Why... But...
186
u/PatchesMaps Apr 29 '21
This has to be someone's experiment playing around with more advanced
try catchbehavior, right? ...please?156
u/Mc_UsernameTaken Apr 29 '21
One unsee juice please.
31
u/MariusJusc Apr 29 '21
Feeling amazed and horrified, not sure how to react to this lol
19
u/Slipguard Apr 29 '21
Is this the programming equivalent of juggling?
52
u/Ailko Apr 29 '21 edited Apr 29 '21
Image Transcription: code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
11
u/Kyyken Apr 29 '21
I wasn't even aware you can throw anything in js.
8
u/JustBlaReddit Apr 29 '21
Someone just really wanted to be on this sub, didn't they?
13
u/szescio Apr 29 '21
Hey, react does it so why shouldn't you 😁
6
u/theclovek Apr 29 '21
These levels of WTF shouldn't even be possible
6
u/[deleted] Apr 29 '21
This is horrible. But also quite clever. Interesting
2
u/awesomeness2078 Apr 29 '21
can someone explain to my filthy casual ass what this means
8
u/toi80QC Apr 29 '21
After browsing Gamestop/GME subs for last hour, this makes more sense than most things I've seen in there... my head hurts.
3
u/Beach-Devil i++++; Apr 29 '21
this sickens me
2
u/INTO_NIGHT Apr 29 '21
I hope this breaks and doesn’t work cuz if it does I might need to abandon us forever if this monstrosity somehow works
2
u/Isvara Apr 29 '21
I kind of like this, but only because I presume it was done for a laugh.
2
u/IlliterateJedi Apr 29 '21
Looks like someone is trying to make up for all the times their dad didn't play catch with them
2
u/arpitansu Apr 29 '21
This looks like some experiment not bad code.
2
u/itsTyrion Apr 29 '21
Does that even work?!
3
u/RecDep Apr 29 '21
Ah yes, continuation-passing style.
1
u/brianmose Apr 29 '21
i can not even describe how much i hate this 😩
1
u/Bdpz Apr 29 '21
It is only obvious that if you want to catch something, someone has to throw it first.
1
u/Tyaemiaes Apr 29 '21
This is what happens when you don't have time to play catch with your kids.
1
u/RusAD Apr 29 '21
Juggler-oriented programming
1
u/KCGD_r Apr 29 '21
I mean, I guess it's alright if declaring a variable somehow consistently fails..
1
u/o_in25 Apr 29 '21
I refuse to believe this is real
1
u/gatlin Apr 29 '21
Me trying to get TCO out of WebAssembly.
1
u/Heniadyoin1 Apr 29 '21
Of you make your return types throwable in python or use python2 you can use raise as a way to return, and that may simplify return type checking/differentiation
1
u/Badel2 Apr 29 '21
This way you avoid people saying that you should have used const instead of let, +1
1
u/INTJ_takes_a_nap Apr 29 '21
I almost want to give them a point for creativity. Almost.
1
u/walshk8 Apr 29 '21
My head hurts
1
u/Xx_heretic420_xX Apr 29 '21
Okay, I think we need to call in an exorcist to deal with this abomination. That code is cursed.
1
u/[deleted] Apr 29 '21
"Why I don't use let in JavaScript"
1
u/Blackbird-ce Apr 29 '21
I see this, I keep thinking of putting four condoms on top of each other...
1
u/tiduseQ Apr 29 '21
I love it!
1
u/Raspberry-Pizza Apr 29 '21
5hats some fine pre es6 block scope without functions
0
u/ghostwilliz Apr 29 '21
:(
0
u/[deleted] Apr 29 '21
[deleted] — view deleted comment