Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

javscript how check if string is empty code example

Example 1: 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
}

Example 2: empty string in javascript

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

Tags:

Php Example

Related

last five elements of list python code example compare two strings ignoring spaces code example substring function in sql code example how to clone a git repo using bash code example reference to clicked button jquery code example drop a key from mysql table code example mongo db show dbs code example string builder api code example class fa logout code example remove class via jquery code example get display values indexof code example how to link google fonts in html code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy