Hacker News new | ask | show | jobs
by invisible 5722 days ago
Sometimes it is "easier" to just type: if (isThisReturningEmpty()) {} instead of typing: if (isThisReturningEmpty() === "") {}

And if you know something could return 0 (which is not empty), you should know to do a type-sensitive check). You are trading off HAVING to set types with HAVING to check types when needed (I think the latter is better).