From the course: JavaScript Essential Training
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Practice: Build a new object with a constructor - JavaScript Tutorial
From the course: JavaScript Essential Training
Practice: Build a new object with a constructor
- Classes feature heavily in modern JavaScript frameworks and getting comfortable with writing and using them will be a huge asset to you as you started working with advanced JavaScript sites and applications. To help you solidify your understanding of classes right away here's a practice assignment for you. In the practice files you'll find the backpack class we've been working with so far. Using this class as a reference, I want you to create new classes based on one or more of the objects you created in the previous practice sessions. I recommend creating separate files for each class and importing them as modules so you have a clear separation of concerns. The easiest approach to building a new class is to start with a fully built out object and then migrate the properties and methods over one by one. Then once the class is complete, you can test it by recreating the original object using that class. Build several…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Objects: A practical introduction4m 53s
-
(Locked)
JavaScript objects: The code version2m 57s
-
(Locked)
Object containers2m 22s
-
(Locked)
Object properties55s
-
(Locked)
Accessing objects2m 32s
-
(Locked)
Accessing object properties5m 35s
-
(Locked)
Practice: Build a new object1m 18s
-
(Locked)
Object methods6m 29s
-
(Locked)
Practice: Build a new method56s
-
(Locked)
Classes: Object blueprints6m 35s
-
(Locked)
Object constructors2m 21s
-
(Locked)
Practice: Build a new object with a constructor1m 13s
-
(Locked)
Global objects7m 47s
-
(Locked)
Challenge intro: Create a new object type2m 5s
-
(Locked)
Solution: Create a new object type3m 16s
-
-
-
-
-
-
-
-
-