Check for empty & null JavaScript strings #javascript #shorts

preview_player
Показать описание
We go through 2 ways to check for empty, null, or strings with text. There are subtle differences between the following that can trip you up if you aren't aware:
if (!s1)
if (s1)
if (s1==="")
if (s1!==="")
Рекомендации по теме