DEV Community

Mehul Lakhanpal
Mehul Lakhanpal

Posted on • Originally published at codedrops.tech

1 2

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.

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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay