Transcript from the "Types Summary" Lesson
>> Kyle Simpson: So the point is that, like every other operation, the real question you should be asking yourself is, is the coercion helpful? Is it gonna be useful to me at this point or not? It puts the onus on you. As you're learning to be a better developer, you should be making critical thinking decisions for yourself.
[00:00:18] Rather than relying upon what somebody wrote in a tweet or a book somewhere, someday, ten years ago, you should really be asking yourself, for this particular situation, is it gonna be helpful to me or not?
>> Kyle Simpson: My claim, my thought is that the double equals is not really about comparisons with unknown types.
[00:00:38] That's sort of the the fear that is often spread about this topic, is that the double equals is, you have these unknown types and have all these weird corner cases and stuff. That's not really what double equals is about because the more important thing, the thing I want you to take away from this discussion, is that you should be making your types obvious when you make your comparisons.
[00:00:57] Make it clear that you've got a number and a number. And if you know the types, then double equals is entirely safe. You can use it in places where you know the types, and then you can optionally decide to use it in places where you wanna allow the coercion.
[00:01:12] For example, that null and undefined case that I just listed.