Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can i check if a particular value is existed in object or not using console?

I am new there . I want to check in console only without declaring any another variable if a particular value is existed in the object or not ?

For example :
var obj = { name: "Clarion" , id:"0" ,… }

Now i want to check if name is existed in the object or not !!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use my code :

const BTS = { name: 'Kim Seok-jin', stageName: 'Jin' };
console.log('name' in BTS);
console.log('age' in BTS);

OUTPUT :

true
false

Happy Coding !!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading