const address = {
street: "bew1111",
city: "err111",
country: "ind11"
};
const address2 = {
street: "bewscxsd",
city: "errdc",
country: "indcdsc"
};
we have two objects here and I am going to use 2 methods for assign both objects into Array
Object.entries()
Object.keys()
1st one starts here-----
var firstar = Object.entries(address);
here I assigned address into firstar
and when you will run this you will get output like this
(3) [Array(2), Array(2), Array(2)]
2nd one starts here
var secstar = Object.keys(address2);
here I assigned address2 into secstar
and when you will run this you will get output like this
(3) ["street", "city", "country"]