Describing my object
object1 ={
name: xxx,
Id: 212
}
I want to transform it into:
{
212:xxx
}
Is there anyone who can guide me on how to achieve this?
for(var key in object1) {
if(object1.hasOwnProperty(key))
{
console.log( eachPeriod[key]);
}
}