Premium Only Content
 
			Learn JavaScript NESTED OBJECTS easy! 📫
00:00:00 example 1
00:04:24 example 2
// nested objects = Objects inside of other Objects.
// Allows you to represent more complex data structures
// Child Object is enclosed by a Parent Object
// Person{Address{}, ContactInfo{}}
// ShoppingCart{Keyboard{}, Mouse{}, Monitor{}}
class Person{
constructor(name, age, ...address){
this.name = name;
this.age = age;
this.address = new Address(...address);
}
}
class Address{
constructor(street, city, country){
this.street = street;
this.city = city;
this.country = country;
}
}
const person1 = new Person("Spongebob", 30, "124 Conch St.",
"Bikini Bottom",
"Int. Waters");
const person2 = new Person("Patrick", 37, "128 Conch St.",
"Bikini Bottom",
"Int. Waters");
const person3 = new Person("Squidward", 45, "126 Conch St.",
"Bikini Bottom",
"Int. Waters");
console.log(person1.name);
console.log(person1.age);
console.log(person1.address);
console.log(person1.address.street);
console.log(person1.address.city);
console.log(person1.address.country);
- 	
				  DLDAfterDark7 hours ago $6.24 earnedDon't Worry - Things Will Get SO Much Worse! Sometimes It Be Like That17K3
- 	
				 25:41 25:41Robbi On The Record12 hours ago $2.22 earnedThe Billion-Dollar Lie Behind OnlyFans “Empowerment” (Her Testimony Will Shock You) | part II11.1K8
- 	
				 12:22 12:22Cash Jordan4 hours ago"CHICAGO MOB" Fights Back... "ZERO MERCY" Marines DEFY Judge, SMASH ILLEGALS22.3K38
- 	
				 46:58 46:58Brad Owen Poker16 hours agoI Make QUAD ACES!!! BIGGEST Bounty Of My Life! Turning $0 Into $10,000+! Must See! Poker Vlog Ep 32312.9K6
- 	
				 2:52:28 2:52:28TimcastIRL7 hours agoSTATE OF EMERGENCY Declared Over Food Stamp CRISIS, Judge Says Trump MUST FUND SNAP | Timcast IRL233K129
- 	
				 3:22:45 3:22:45Tundra Tactical14 hours ago $20.28 earned🚨Gun News and Game Night🚨 ATF Form 1 Changes, BRN-180 Gen 3 Issues??, and Battlefield 6 Tonight!38.6K4
- 	
				 1:45:13 1:45:13Glenn Greenwald10 hours agoJD Vance Confronted at Turning Point about Israel and Massie; Stephen Miller’s Wife Screams “Racist” and Threatens Cenk Uygur with Deportation; Rio's Police Massacre: 120 Dead | SYSTEM UPDATE #540115K164
- 	
				 LIVE LIVESpartakusLIVE8 hours agoSpart Flintstone brings PREHISTORIC DOMINION to REDSEC334 watching
- 	
				 1:05:02 1:05:02BonginoReport11 hours agoKamala CALLED OUT for “World Class” Deflection - Nightly Scroll w/ Hayley Caronia (Ep.167)133K83
- 	
				 54:36 54:36MattMorseTV9 hours ago $29.85 earned🔴The Democrats just SEALED their FATE.🔴63.2K109