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);
-
11:08
SLS - Street League Skateboarding
23 hours agoNyjah Huston on his most memorable SLS Wins, Nollie Flip Back Lips, the SLS Miami Course & more...
2.27K2 -
UPCOMING
Film Threat
12 hours agoTHE ACCOUNTANT 2 + CHEECH & CHONG + TONS OF REVIEWS! | Film Threat Livecast
434 -
UPCOMING
Tudor Dixon
1 hour agoThe Impact of the Biden Pill Penalty with Tim Murtaugh | The Tudor Dixon Podcast
90 -
14:35
SKAP ATTACK
9 minutes agoThe Denver Nuggets are a Disgrace
-
59:26
VINCE
3 hours agoJUSTICE! FBI Arrests Corrupt Judge - w/ Guest Mike Davis | Episode 30 - 04/25/25
160K93 -
DVR
Matt Kohrs
10 hours agoMarkets Finally Push Higher!!! || The MK Show
67.4K -
LIVE
Bannons War Room
2 months agoWarRoom Live
14,217 watching -
LIVE
LFA TV
14 hours agoALL DAY LIVE STREAM - 4/25/25
8,687 watching -
DVR
Badlands Media
8 hours agoBadlands Daily: April 25, 2025
28.5K3 -
LIVE
Caleb Hammer
1 hour agoI Can't Do This Anymore | Financial Audit
116 watching