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);
-
28:54
Producer Michael
14 hours agoANSWERING YOUR MOST IMPORTANT QUESTIONS!
7.63K2 -
8:24
Hollywood Exposed
13 hours agoCNN Host Turns on Democrats LIVE And Bill Maher Can’t Believe It!
3.34K9 -
30:59
Uncommon Sense In Current Times
17 hours ago $0.45 earnedImmigration, Crime & Justice Reform | Brett Tolman on Borders, Cartels & the First Step Act
10.4K1 -
15:36
The Gun Collective
13 hours agoWOW! Tons of NEW GUNS just dropped!
4.23K10 -
LIVE
BEK TV
23 hours agoTrent Loos in the Morning - 10/08/2025
147 watching -
2:21
NAG Daily
12 hours agoPOLITICAL FAMILY GAMESHOW w/ GreenMan Reports
4.07K -
0:49
OfficialJadenWilliams
16 hours agoGTA 6 is downloading but you hear trumpets outside
4.29K4 -
1:02:11
DeVory Darkins
15 hours ago $41.70 earnedDemocrats suffers ANNIHILATION during heated hearing with Bondi as Jack Smith bombshell drops
171K133 -
57:17
Dialogue works
2 days ago $3.36 earnedAmb. Chas Freeman: Israel on the EDGE: Is TOTAL DEFEAT IMMINENT?!
39.4K21 -
14:06
Actual Justice Warrior
1 day agoSomali Medicaid SCAMMER Says Theft Is HIS CULTURE
20.4K26