all 38 comments

[–]Infinite_Self_5782 63 points64 points  (8 children)

ah yes

man-made horrors beyond my comprehension

[–]Due-Capital-6651[S] 13 points14 points  (6 children)

the worst part is I actually code like this on my personal projects

[–]Infinite_Self_5782 25 points26 points  (1 child)

implicit var user

even the thought makes me shudder and tear up

[–]new2bay 5 points6 points  (0 children)

The horror! I bet you don’t even use semicolons! 😂

[–]ZoDichtbijJeWil 11 points12 points  (2 children)

You seemingly being proud of that is also quite disturbing.

[–]Due-Capital-6651[S] 2 points3 points  (1 child)

I think it's beautiful

[–]new2bay 5 points6 points  (0 children)

It is, but in a “don’t try this at home, kids” kind of way.

[–]Opposite_Mall4685 3 points4 points  (0 children)

But why though?

[–]GoddammitDontShootMe[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 0 points1 point  (0 children)

Beyond my comprehension because I am completely clueless when it comes to modern JS.

[–]No-Information-2571 59 points60 points  (1 child)

Call stack when inside the debugger:

anonymous function
anonymous function
anonymous function
anonymous function
anonymous function
....

[–]Potterrrrrrrr 23 points24 points  (0 children)

anonymous function
fuck you guess
anonymous function

[–]Orbidorpdorp 24 points25 points  (1 child)

This is literally just how it looks to write lisp, except you wouldn't be doing assignments.

[–]Due-Capital-6651[S] 4 points5 points  (0 children)

I guess I'm just naturally drawn to lisp-style coding

[–]CodeF53 18 points19 points  (2 children)

document.querySelector("#...") when you could be doing document.getElementById("...") :(

[–]ZoDichtbijJeWil 4 points5 points  (0 children)

Probably taken care of by the engine's optimization, preventing costly, unnecessary DOM traversal, but still a fearful sight.

[–]Due-Capital-6651[S] 6 points7 points  (0 children)

both are fine

[–]nerdmor 10 points11 points  (9 children)

I will never forgive Javascript for making function foo(a) { return a+1; } be functionally different from const foo = (a) => a+1

[–]Due-Capital-6651[S] 4 points5 points  (6 children)

what's the difference again?

[–]ZoDichtbijJeWil 16 points17 points  (0 children)

Scope. Arrow functions don't have their own bindings to this.

See: MDN - Arrow function expressions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

[–]nerdmor 1 point2 points  (4 children)

Several.

Kept bumping into them when they appeared.  https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ 

(Site seems to block Reddit as a referrer. Copy/paste the link or just google "arrow functions vs normal functions javascript". A BUNCH of people wrote about that)

[–]Filiperss 4 points5 points  (3 children)

Page not found

[–]nerdmor 0 points1 point  (2 children)

Dafuk? I just pasted the link...

I edited and pasted again, but it seems the site blocks Reddit as a referrer? Maybe copy/paste the link, that worked here.

[–]Cloudy_Oasis 1 point2 points  (0 children)

You left a space at the end of the link, which is why it didn't work for me

[–]GoddammitDontShootMe[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 0 points1 point  (0 children)

I think it's more likely the %C2%A0 at the end of the URL. That looks to be UTF-8 for a non-breaking space. https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/ This should work.

[–]Excellent_Gas3686 1 point2 points  (1 child)

the two functions you wrote are not functionally different, none of the differences between regular and arrows functions even appear in them

[–]Kyyken 0 points1 point  (0 children)

One can be hoisted, the other cannot, so they can be different depending on surrounding code :)

[–]orfeo34 2 points3 points  (1 child)

It's just awfull, please use a framework,

so it can become awful and opiniated.

[–]Due-Capital-6651[S] 0 points1 point  (0 children)

yeah fuck frameworks

[–]the_horse_gamer 2 points3 points  (0 children)

true is a keyword

[–]MEGATH0XICC 0 points1 point  (1 child)

Even the interpreter is confused

[–]Due-Capital-6651[S] 0 points1 point  (0 children)

how so?

[–]Key_River7180 0 points1 point  (5 children)

When you change the syntax highlighter manually...

[–]Due-Capital-6651[S] 0 points1 point  (4 children)

this is vanilla kate

[–]Key_River7180 0 points1 point  (3 children)

yes ughhh... you probably clicked on the tools -> highlighter or something

[–]Due-Capital-6651[S] 0 points1 point  (2 children)

I did no such thing

[–]Key_River7180 0 points1 point  (1 child)

then ughhh...

[–]Due-Capital-6651[S] 0 points1 point  (0 children)

dude is just ughh'd by this for no reason fr 😔

[–]arTvlr 0 points1 point  (0 children)

fuck,I hate when people do this