JavaScript Periksa apakah ruang kosong

function isEmptyOrSpaces(str){
    return str === null || str.match(/^ *$/) !== null;
}
Expensive Earthworm