Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript if string empty

// Test whether strValue is empty or is None
if (strValue) {
    //do something
}
// Test wheter strValue is empty, but not None 
if (strValue === "") {
    //do something
}
Comment

empty string in javascript

var s; // undefined
var s = ""; // ""
s.length // 0
Comment

PREVIOUS NEXT
Code Example
Javascript :: history.back() and refresh in js 
Javascript :: how to hide api key in react 
Javascript :: bouton scroll en haut 
Javascript :: get field type file js and loop 
Javascript :: clear ckeditor textarea jquery 
Javascript :: prototype in javascript class 
Javascript :: rc-notification react 
Javascript :: javascript filter array return index 
Javascript :: switch statement in javascript 
Javascript :: express alternatives 
Javascript :: js regex word before word 
Javascript :: area selection on image using javascript 
Javascript :: {"statusCode":400,"error":"Bad Request","message":"Unexpected token o in JSON at position 1"} 
Javascript :: less than equal to in javascript 
Javascript :: proxmox local storage path 
Javascript :: add clickable link to image in react native 
Javascript :: next auth 
Javascript :: react-with-firebase-auth 
Javascript :: contextMenus chrome extensions 
Javascript :: parse string javascript 
Javascript :: radio button schema mongoose 
Javascript :: bind this react 
Javascript :: js method .sort 
Javascript :: google places autocomplete react native 
Javascript :: listen for double click before click 
Javascript :: js get formatted time 
Javascript :: notify jquery 
Javascript :: detect localstorage limit 
Javascript :: juqery get label text 
Javascript :: isodate mongodb nodejs 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =