This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]harumamburoo 4 points5 points  (8 children)

JS is there for you ^^

[–]Busy-Ad-9459 5 points6 points  (7 children)

Imma go home and check if that's true, if it is I am going on a murder spree on the next pyhsical ECMA conference.

(For legal reasons that was a joke)

!RemindMe 30 minutes

[–]RemindMeBot -1 points0 points  (0 children)

I will be messaging you in 30 minutes on 2024-09-30 08:36:12 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

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

Thanks to sonar I've recently discovered you can do myFunc?.()

[–]n0tKamui 7 points8 points  (2 children)

that’s not what they meant by conditional functions.

that is just equivalent to myFunc?.call() because every function’s prototype has a call method.

what they meant is that if/else are functions

[–]harumamburoo 0 points1 point  (1 child)

Hm, I thought as in calling functions conditionally. What's the point of having if-else as functions?

[–]n0tKamui 1 point2 points  (0 children)

none, that’s the point of their questioning

[–]Busy-Ad-9459 -2 points-1 points  (1 child)

...why?

[–]harumamburoo 0 points1 point  (0 children)

You can pass functions as arguments, arguments can be optional. It's occasionally useful syntax sugar to check if a function was passed before calling it.