this post was submitted on 27 Jul 2023
1200 points (96.5% liked)

Technology

59204 readers
3598 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


founded 1 year ago
MODERATORS
 

I think we need all support we can get to fight Google on this, so I welcome Brave here actually.

Use this link to avoid going to Twitter:

https://nitter.kavin.rocks/BrendanEich/status/1684561924191842304

you are viewing a single comment's thread
view the rest of the comments
[–] EuphoricPenguin22@normalcity.life 2 points 1 year ago* (last edited 1 year ago)

I was incorrect; the first part of my answer was my initial guess, in which I thought a boolean was returned; this is not explicitly the case. I checked and found what you were saying in the second part of my answer.

You could use strict equality operators in a conditional to verify types before the main condition, or use Typescript if that's your thing. Types are cool and great and important for a lot of scenarios (used them both in Java and Python), but I rarely run into issues with the script-level stuff I make in JavaScript.