Global Feed Post Login
Replying to Avatar josh

const myFunc = () => {}

function myFunc () {}

const myFunc = new function(“x”, “y”, “return x + y”)

I guess only 3

Avatar
fiatjaf 1y ago 💬 6

Which one do you prefer?

nostr:nevent1qy88wumn8ghj7mn0wvhxcmmv9uq3zamnwvaz7te3xsczue3h0ghxjme0qythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap0qywhwumn8ghj7mn0wd68ytndw46xjmnewaskcmr9wshxxmmd9uq36amnwvaz7tmwdaehgu3wvf5hgcm0d9hx2u3wwdhkx6tpdshszxmhwden5te0wfjkccte9emk2um5v4exucn5vvhxxmmd9uq3zamnwvaz7tmwdaehgu3wwa5kuef0qyt8wumn8ghj7ur4wfcxcetjv4kxz7fwvdhk6tcpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhszxthwden5te0wfjkccte9eekummjwsh8xmmrd9skctcqyqv7pknnywuhqxnxu3f9hvr2ywan2rntqau8y5rmlxd40trgelq3s3gdmqp

Reply to this note

Please Login to reply.

Discussion

Avatar
Ingwie Phoenix (aka. birb) 1y ago

I like 1st, but only when it has an argument, because then it reads cleaner.

Second feels the most natural.

Third is cringe. x)

Avatar
fiatjaf 1y ago

But the second reads much cleaner, it even says "function" at the beginning!

Thread collapsed
Thread collapsed
Avatar
BtcBadger 1y ago

#3, the code is the documentation

Thread collapsed
Avatar
Mr. Khan 1y ago

Second one is perfection.

Thread collapsed
Avatar
nikola 1y ago

2.

Thread collapsed
0b
gregregre 1y ago

Nr 1 always. Saves you from the traps of "this".

Thread collapsed