1. What is the best way to test an array or object using jQuery undefined + null?
I check the array as follows:
function f1(arr){
if(arr!==undefined&&arr!=null){
}
}
Does jquery have a better way?
2. What is the best way to test String with JQuery (str) trim! == ""?
I check String as follows:
function f2(str){
if(str!==undefined&&str!=null&&$.trim(str)!==''){
}
}
Does jquery have a better way?
thank
source
share