How to Determine Whether a JavaScript Object Is Emptyby@smpnjn

How to Determine Whether a JavaScript Object Is Empty

tldt arrow
Read on Terminal Reader🖨️

Too Long; Didn't Read

Defining a new object in Javascript is pretty easy - but what if you want to find out if it's empty? For example, {} is an empty object, but how do we actually test that this is the case? The easiest (and best) way to do this, is to use Object.keys().
featured image - How to Determine Whether a JavaScript Object Is Empty
Johnny Simpson HackerNoon profile picture

@smpnjn

Johnny Simpson

About @smpnjn
LEARN MORE ABOUT @SMPNJN'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa