JSは、文字列が空であるか否かを判断します

メインのフロントエンド、バックエンドのダサ書き込みチャープ叫びう

関数のisEmpty(STR){ 
    (typeof演算STR == NULL || STR == "" || STR == "未定義")は{場合に
        trueを返します。
    }他{ 
        falseを返します。
    } 
}

  

(のisEmpty(ind_vue.params.userId)){場合
    はconsole.log( "はuserId")。
} 
IF(のisEmpty(ind_vue.params.dayStart)){ 
    にconsole.log( "dayStart")。
} 
IF(のisEmpty(ind_vue.params.dayEnd)){ 
    にconsole.log( "dayEnd")。
} 
(のisEmpty(ind_vue.params.timeStart)){場合
    はconsole.log( "timeStart")。
} 
IF(のisEmpty(ind_vue.params.timeEnd)){ 
    にconsole.log( "timeEnd")。
}

  

おすすめ

転載: www.cnblogs.com/zlrrrr/p/11465940.html