DEV Community

loading...

Lodash: _.isEmpty() - Check falsy values

Mehul Lakhanpal
Full stack Developer | Micro-blogging on Web Development at codedrops.tech | Creator of File Ops, Note Box, GitHub Marker
Originally published at codedrops.tech ・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
Enter fullscreen mode Exit fullscreen mode

Thanks for reading 💙

Follow @codedrops.tech for more.

InstagramTwitterFacebook

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

Discussion (0)