Every line of 'javascript check empty variable' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
127 function emptyCheck(v) { 128 return v != null && v.length > 0; 129 }
626 function isVariableEmpty(variable) { 627 return variable === "" || variable === presenter.configuration.emptyAnswer; 628 }
1171 function isLikeEmpty(inputVar) { 1172 if (typeof inputVar !== 'undefined' && inputVar !== null) { 1173 let strTemp = JSON.stringify(inputVar); 1174 strTemp = strTemp.replace(/\s+/g, ''); // remove all whitespaces 1175 strTemp = strTemp.replace(/\"+/g, ""); // remove all >"< 1176 strTemp = strTemp.replace(/\'+/g, ""); // remove all >'< 1177 strTemp = strTemp.replace(/\[+/g, ""); // remove all >[< 1178 strTemp = strTemp.replace(/\]+/g, ""); // remove all >]< 1179 if (strTemp !== '') { 1180 return false; 1181 } else { 1182 return true; 1183 } 1184 } else { 1185 return true; 1186 } 1187 }
23 function isNotEmpty(variable) { 24 return (undefined !== variable && null !== variable); 25 }