1034
JavaScript (lemmy.ml)
(page 2) 50 comments
sorted by: hot top controversial new old
[-] calavera@lemmy.zip 5 points 5 days ago
[-] PieMePlenty@lemmy.world 2 points 4 days ago

It does to some degree.

  • "11" is string, 1 is an int, because strings can be added (+) convert int to string and combine: "11"+"1" = "111"
  • "11" is string, 1 is an int, because strings cant be subtracted (-) convert string to int and combine: 11-1 = 10

I'm not into JS so I don't know how it takes priority. ints can be added too, so I guess its basing it on the first variable which is compatible with the operator: in the first case string, in the second case int.

If this is how it works, it makes sense. But imo its a case of the designers being preoccupied with whether or not they could, they didn't stop to think if they should.

load more comments (4 replies)
[-] cupcakezealot@lemmy.blahaj.zone 2 points 4 days ago* (last edited 4 days ago)

javascript is to web developers what powerpoint is to sales people

[-] kamen@lemmy.world 4 points 5 days ago

If you're consciously and intentionally using JavaScript like that, I don't want to be friends with you.

[-] sirico@feddit.uk 5 points 6 days ago

Oh we've hit an issue that's solved by another language or we could make another framework

load more comments
view more: ‹ prev next ›
this post was submitted on 04 Jun 2025
1034 points (98.6% liked)

Programmer Humor

24045 readers
1279 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 2 years ago
MODERATORS