This video.
Let's talk about the last method and that is the object dot entries.
Let's have some enough room to code.
So let me copy this one.
And then let me comment this one out.
Now come down.
Here it and here is going to be my objects.
Dot entries.
So what is it?
Well, the object dot entries method, it retains an array where each array contains a key and the value.
Well, this is really useful when you want to treat over the properties of an object.
Well, so let's see.
Let's in action to better understand this definition I gave you.
So const.
Let's say my object entries now is is entries is equal to object uppercase dot entries.
Then I'll pass in my person object.
How is that?
So if I console that look, my object entries have a look.
Okay.
Open it.
We see that.
It has put in the individual properties in a separate array.
So let me show you that the first one is first name.
So that the first one give me array.
We have the first name, the key and the value is John.
The next property was last name and then my value.
They have put everything in a separate word array.
So there are some useful there are some use cases where you may need this concept.
Well, so for this one, we can go ahead and also maybe we can use for loop to loop through this element
and get the individual entries.
Or let's use for loop, let's use for a loop to see how we can loop through this one and you see how
you're going to get the result.
So here I'm going to have the object entries dot for each loop.
For each loop pass in my callback function.
And now here I get access to the individual entry and then my carry basis.
So here, our console log the entry.
Let's see now and see that I get it as before.
But now I have them separately inside my for each loop and you cause something destruction assignment
so the same way.
So here it is advanced.
Don't worry.
The whole idea is get know how to use these entries and how.
And I mean the meaning of these entry method and how they are used.
As we move on and by solving some coding challenges, you better understand them in some way.
Use cases.
So here, what I'm going to do is I'm going to use a method called distraction assignment.
Let me show you.
Destruction assignment.
So let's see.
I would take my entries, my assets, my object, and let me comment this one out.
So this one is reason for loop.
Okay, so I would take my object entries, object entries and then dot for each the same way.
Dot for each, for each.
Then my callback function I'll start and then I'll start.
But inside my callback function I'm going to structure this.
Also a new feature in Java code instruction.
For the meantime, just bear with me.
Remember that this entries retains array of key value pairs.
Let me show you here.
So if our comment this one out, let's see we see that we have the key and a value.
So this once represent the individual entry inside this function I'm going to have so I can structure
that using a mean square bracket.
So inside my callback function.
Here.
Now I can do structure.
And then the first key.
The first one is my key and comma, my value.
So in here I can console.log it and give it some nice details and say that, well, I'm going to have
my my temporarily try here dollar sign carry basis and then I have my key, my key here inside that
and then I'm going to have semicolon and then I'll have my dollar sign, curly braces and my value.
So let me comment this one.
I want to see the results of this one and now have a look.
We see I get first name John, last name double H like that and like that.
Like I said, there are some use cases where you may need this concept.
Not always you may need, but in some use cases.
Well, guys, so here ends the object basics even though it is not business but high C is a basic right
because advance I'm going to make things more complicated.
I mean by I then I mean advanced object to a method, right?
So the next video, let's start with our first coding challenge.