How to check JSON object or JS object is empty? | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
August 17, 2022

How to check JSON object or JS object is empty? | AEM Community Blog Seeding

  • August 17, 2022
  • 0 replies
  • 451 views

BlogImage.jpg

How to check JSON object or JS object is empty? by Rashid jorvee

Abstract

if (!Object.keys(jsonObj).length === 0) {
console.log("JSON object have some keys and values");
} else {
console.log("JSON object is empty");
}


Here jsonObj is JSON or JavaScript object.

Read Full Blog

How to check JSON object or JS object is empty?

Q&A

Please use this thread to ask the related questions.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.