Here, I created an object say d.
var d={
a:"firstName",
b:"lastName"
};
Now I want to create another object say A, which inherits properties of d.
var A=Object.create(d);
console.log(A.a);//returns "firstName"
console.log(A.b);//returns "lastName"
But when I uses console.log(A);// returns empty object, as it doesn't show inherited properties.
But it creates little problem while using with angular.forEach.
I want to use angular.forEach which parse all properties including inherited properties. How can I loop through object including parent properties?
I have to use Object.create as parent object is dynamic, i.e. It may include more objects in future, and these properties will automatically comes in child object. Here I cant use angular.copy as it does deep copy and breaks relation between parent object.
In previous version of google chrome, see inherited properties also. But after updating to version 43.0.2357.52, its not showing inherited properties in console