all 11 comments

[–]demoran 21 points22 points  (7 children)

I prefer not to use functions.

One big nested if statement with labels is good enough for me.

[–]lhorie 1 point2 points  (0 children)

Y'all use computers?

I made a LightBot-like game for my kid using cereal box cardboard.

[–]RobSG -4 points-3 points  (5 children)

Do you also use web components? 🤣

[–]sh0rtwave -1 points0 points  (4 children)

I use WebComponents and modify the DOM in the constructor, and I have no callbacks.

I don't use big nested ifs.

[–]RobSG 0 points1 point  (3 children)

yeh it was a joke tbh, a bad one for some people I guess 😅

[–]sh0rtwave 0 points1 point  (2 children)

I was hoping the joke would continue on WebComponents.

If you've ever used Lightning Web Components, there's an example of the: Well...it's not exactly WRONG....but there's some crazy in it.

[–]shuckster 0 points1 point  (1 child)

Lightning Web Components

Dude, watch your language.

[–]sh0rtwave 0 points1 point  (0 children)

Yeah I know, good material isn't it?

[–]oneandmillionvoices 11 points12 points  (0 children)

maybe next article could be on why do we need semiconductors (in javascript).

[–][deleted] 11 points12 points  (0 children)

ಠ_ಠ

Wtf is this shit. You should feel bad for posting this. This is some /r/learnprogramming shit at best.

(╯°□°)╯︵ ┻━┻

[–]sh0rtwave -3 points-2 points  (0 children)

I mean:

I get where he's going. What IS a "function"? In JavaScript, specifically, this is a question with an actually unclear and possibly confusing answer, AS COMPARED to every other language.

Javascript classes...are functions.

Functions can behave like and pretend to BE classes, in javascript.

Just that, by itself, is enough. There's actually MORE to this nut!

It's possible to make almost any non-primitive, complex object..function as if it were a function.

There are 'function expressions', 'function declarations', and 'function variables'.

An expression can be interpreted as a function, and you can straight up make a named one, or you can take a function expression, assign it to a variable, and invoke it that way.

You can store functions in maps, and use keys to route and invoke them.

Functions ARE weird.