FrontendChallenges is a collection of frontend interview questions and answers. It is designed to help you prepare for frontend interviews. It's free and open source.
difficulty: medium
title: IsEmpty
template: javascript
tags: javascript, lodash
Question
Write a JavaScript function called isEmpty that takes a single argument and checks if it represents an empty object, collection, map, or set. The function should return true if the input is empty and false otherwise.
Info
Question
Write a JavaScript function called
isEmpty
that takes a single argument and checks if it represents an empty object, collection, map, or set. The function should returntrue
if the input is empty andfalse
otherwise.Example:
Template
index.js
index.test.js