Check Object is empty in Javascript

Check Object is empty in Javascript if an object is empty in JQuery we use jQuery.isEmptyObject( object ) with will return true on success , false on failure.

Example :

 

 

To check if an object is empty or not using Javascript we use Object.getOwnPropertyNames() .The Object.getOwnPropertyNames() method returns an array of all properties (enumerable or not) found directly upon a given object.

 

As a function :

 

How to use :

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – we are here to solve your problems.

I, Dayanand Saini,the founder and chief editor of www.webtechsource.com,have been working as a software engineer from last 4+ years. It's my hobby to learn new things and implement on live environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

15 + = 25

%d bloggers like this: