I can't figure this out...
I have two simple objects defined:
var adam = {
name: "Adam",
spouse: terah
}
var terah = {
name: "Terah",
age: 32,
height: 66,
weight: 125,
hairColor: "brown",
spouse: adam
}
The only property I'm concerned with is the spouse property. When I test:
console.log(terah.spouse.spouse);
> Object {name: "Terah", age: 32, height: 66, weight: 125, hairColor: "brown"…}
I get the object I want here. But when I make it a conditional
terah.spouse.spouse === terah;
>false
I get false... Why is this? It seems to be pointing to the same object. Even when I call
terah.spouse.spouse.name === "Terah"
>true
I get true there. Why do I get false with the object conditional? Thanks.`
adam.spousewill beundefined. I assume this is not your actual code. As such, you should provide actual code that demonstrates the issue.adam .. {spouse: terah}before terah is defined? or how will you defineterah {spouse: adam}before adam is defined? this gives me a headache...terah.spouse.spousewill resultundefinedterah.spouse.spouse.name === "Terah"all I get isTypeError: 'undefined' is not an object (evaluating 'terah.spouse.spouse.name')