DEV Community

Mehul Lakhanpal
Mehul Lakhanpal

Posted on • Originally published at codedrops.tech

Lodash: _.isEmpty() - Check falsy values

_.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
Enter fullscreen mode Exit fullscreen mode

Thanks for reading πŸ’™

Follow @codedrops.tech for more.

Instagram ● Twitter ● Facebook

Micro-Learning ● Web Development ● Javascript ● MERN stack

codedrops.tech


Projects

File Ops - A VS Code extension to easily tag/alias files & quick switch between files

Top comments (0)