当前位置: 代码迷 >> JavaScript >> 请教javascript有没有string.IsNullOrEmpty
  详细解决方案

请教javascript有没有string.IsNullOrEmpty

热度:49   发布时间:2012-03-20 14:01:11.0
请问javascript有没有string.IsNullOrEmpty
如题,javascript有没有string.IsNullOrEmpty。如果没有,有没有什么好的代码?

先答先得分!

------解决方案--------------------
null和empty都为false
------解决方案--------------------
js更简单

c#:
if (string.IsNullOrEmpty(str)) ...

js:
if (!str) ...
  相关解决方案