@9point6@lemmy.world
link
fedilink
13
edit-2
1Y

Not true, in the absolute worst case, unknown is what you should be reaching for, but it’s pretty rare that you can’t create some kind of type to interface with JS if it’s not already got types. You can even use jsdoc comments as type hints in the JS too if you own that code.

My not particularly hot hot-take: There’s basically no legitimate use case for any apart from “I don’t have time to type all this now, because I’m converting a massive project from JS to TS”

@jana@leminal.space
link
fedilink
English
51Y

There are some cases where any must be used instead of unknown but they usually involve generic constraints and seem more like a bug than intended behavior

Ah you’re right there, and I also agree, that feels more like a bug than by design

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 38 users / day
  • 138 users / week
  • 529 users / month
  • 2.24K users / 6 months
  • 1 subscriber
  • 1.68K Posts
  • 37.1K Comments
  • Modlog