1280
Is this a Nut? (media.gehirneimer.de)
you are viewing a single comment's thread
view the rest of the comments
[-] _cnt0@sh.itjust.works 10 points 5 months ago* (last edited 5 months ago)

I just dabbled in javascript again, and that description is spot on!

console.log('javascript operators are b' + 'a' + + 'a' + 'a');

[-] sjmarf@sh.itjust.works 10 points 5 months ago
[-] hypnicjerk@lemmy.world 6 points 5 months ago
[-] fishbone@lemmy.world 3 points 5 months ago

Pepperoni and green peppers, mushrooms, olives, chives!

Oh wait wrong song.

[-] arc@lemm.ee 9 points 5 months ago* (last edited 5 months ago)

The only reason people use JS is because it's the defacto language of browsers. As a language it's dogshit filled with all kinds of unpleasant traps.

Here is a fun one I discovered the other day:

new Date('2022-10-9').toUTCString() === 'Sat, 08 Oct 2022 23:00:00 GMT'
new Date('2022-10-09').toUTCString() === 'Sun, 09 Oct 2022 00:00:00 GMT'

So padding a day of the month with a 0 or not changes the result by 1 hour. Every browser does the same so I assume this is a legacy thing. It's supposed to be padded but any sane language would throw an exception if it was malformed. Not JavaScript.

[-] krippix@feddit.de 3 points 5 months ago

I can‘t believe you’ve done this

[-] _cnt0@sh.itjust.works 1 points 5 months ago

Well, not by accident.

this post was submitted on 14 Mar 2024
1280 points (98.5% liked)

Programmer Humor

18872 readers
726 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS