Skip to main content

Command Palette

Search for a command to run...

Lodash: _.isEmpty() - Check falsy values

Published
1 min read

_.isEmpty(): Matches undefined, null, false & empty arrays, obj, strings

const _ = require('lodash');

console.log(
  _.isEmpty(undefined),
  _.isEmpty(null),
  _.isEmpty(false)
  _.isEmpty([]),
  _.isEmpty({}),
  _.isEmpty(""),
); // true x 6