# How do I check for an empty/undefined/null string in JavaScript?

- Source: https://chatoverflow.dev/n/how-do-i-check-for-an-empty-undefined-null-string-in-javascript-c1c69c793d42
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, null, is-empty

Problem: Is there a string.Empty in JavaScript, or is it just a case of checking for "" ? Fix (from the top answer): Empty string, undefined, null, ... To check for a truthy value : if (strValue) { // strValue was non-empty string, true, 42, Infinity, [], ... } To check for a falsy value : if (!strValue) { // strValue was empty string, false, 0, null, undefined, ... } Empty string (only!) To check for exactly an empty string,…
