When you call the function Object.keys
on an object, it returns an array containing the names of the given object's own, enumerable properties. Contrary to the for...in
loop, the inherited properties are not included in the result.
On the other hand, Object.values
returns an array containing the values of the given object's own, enumerable properties.
Similarly, Object.entries
returns an array which contains the own, enumerable properties of the given object as name and value pairs. Each entry is a two-element array, containing the name and value of a property.
Here is an example:
let ali = {
name: "Ali",
age: 19,
};
console.log(Object.keys(ali)); // [ 'name', 'age' ]
console.log(Object.values(ali)); // [ 'Ali', 19 ]
console.log(Object.entries(ali)); // [ [ 'name', 'Ali' ], [ 'age', 19 ] ]
In a for...in
loop, all the properties in the prototype chain are included in the loop. So if you want to only iterate over own properties, you have to use the hasOwnProperty
method or use Object.keys
instead.
your effort on java is nice. it is informative
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
simple but useful .. thanks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
valuable post for me. Thank you sir.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
that is very helpful post...thank you so much
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
valuable post for me. Thank you sir.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I am impressed by your knowledge of Java Script language. Keep posting and let us know about Java in an easy to learn way. Thanks.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Bisyar khub...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@ghasemkiani WOW. Awesome tutorial. Thanks for sharing. Keep sharing please.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You help us too much, and that's why we learn, make a good contribution and work in this community. You can check my blog and support me with a vote of yours if you like
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Excellent informative post for all steemians .Thanks for the sharing informative post.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice post friend
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I love programming... Also the language of JavaScript. I am using the jQuery in my web design template.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
great writing dear @ghasemkiani
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This nice post i like it thanks for sharing technology news..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Really great news.... nice post..thanks for sharing@ghasemkiani
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you sir for nice post
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
so informative post for us.
thanks for sharing
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good way to learn Java.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I am about to learn javascript after 2 weeks, glad i found your blog .
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I really like this post ghasemkiani! keep up the good work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice post haji
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice post.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
that's pretty cool to know....
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Sir, I was a great fan of your idiom.Now I like your posts with JavaScript.Your posts are helping me to know about javascript.
Your article is the best @ghasemkiani
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Helpful post for us...Keep it up.... thanks for share javascript.....
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very useful post about javascript.The post with your javascript is really good.which helps us get a lot of ideas about javascript.
Thank You @ghasemkiani
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for update nice stuff after some days @ghasemkiani
You blog is excellent for ever and you did good work.
My support always with you
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks, Very helpful post. I am learning Javascript. Thanks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Seems you have really a good command on JavaScript.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
well thanks i have started the series as i thought it can help me too ... to learn
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Helpful post for us...Keep it up..Dear..
Carry on your activity...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good activity that is....that basic complement is need for technology.....carry on
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@ghasemkiani JavaScript, I just love you. Please keep posting about JavaScript.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Carry on boss carry on
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice analysis very useful post
Thanks for sharing @ghasemkiani nice post.
Stay blessed
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great thanks for the news. Learned something.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
keep posting like this,your really good at this javascript
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Your post is good, and I'm re-blog your post. Please upvote me. Thanks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Your blog alweys educational for us
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wonderful, senior
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for this technology sharing...... i appreciate this post......
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice post..
very informative...thanks sir
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i'm very sorry dear,, Yesterday I could not come to your blog,,,miss you dear
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice post...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks so much for shared @ghasemkiani :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very good and important for java script
Whatever you have knowledge you sharing
That is very good job
I am happy to follow you
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks a lot for great information..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good post on Java.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
great post. I will try it.
thanks for sharing
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit