Help me pls
if(value == ""){
// do anything
}
but I need to check space " " (2,3,... space is include) is the same way of empty String
ps. sorry in my English
Help me pls
if(value == ""){
// do anything
}
but I need to check space " " (2,3,... space is include) is the same way of empty String
ps. sorry in my English
 
    
    A regex can easily solve this problem.
if (/^ *$/.test(value)) {
    //string contains 0+ spaces only
}
If you need to include null also, then add !value ||.
If you need to include newlines, tabs, and the like, then use /^\s*$/ for the regex.
 
    
    I'm not sure I'm understanding correctly. Do you mean like:
if (value == "" || value == " "){
// do anything
}
