js判斷值是否爲空,null,undefined,爲空返回true,不爲空返回true

function isEmpty(data){ var dataType = typeof(data);//typeof 返回的是字符串,有六種可能:」number」、」string」、」boolean」、」object」、」function」、」undefined」; switch(dataType){ case 「number」://數字 return false; break; case 「
相關文章
相關標籤/搜索