What’s an effective way to check if a value is not null and not an empty string in JavaScript?

Yeah, I’ve bumped into this pattern often enough that I just wrapped it in a helper. When you’re building anything with a team, clarity and consistency are gold. Here’s how we handle checking if JavaScript is not null or empty in our codebase:

function isNotNullOrEmpty(value) {
  return value !== null && value !== '' && value.trim() !== '';
}

// Usage
if (isNotNullOrEmpty(data)) {
  // do something
}

Makes things easier to read, and no one has to second guess what the condition is doing. Plus, having it in one place helps if we need to tweak the logic later.