Gets the parent of the object if such a parent exists.

Returns—The parent of the object. Returns undefined if the object is not nested and does not have a parent.

Example - get the parent object

var observable = new{ person: { name: "John Doe" } });
var person = observable.get("person");
console.log(observable.parent()); // outputs "undefined"
console.log(person.parent() === observable); // outputs "true"
In this article
Not finding the help you need? Improve this article