From the course: JavaScript Essential Training
Schalten Sie den kompletten Kurs noch heute frei
Join today to access over 23,400 courses taught by industry experts.
Solution: Create a new object type - JavaScript Tutorial
From the course: JavaScript Essential Training
Solution: Create a new object type
(upbeat music) - [Instructor] To solve this challenge, we need to create a new object constructor and if we look down in the test code, we already have an indication of what this object constructor's going to look like because we're calling in a new book from the book object constructor and then we're calling in these four properties. So to start off, I'm going to start here and say create a new function, then call it book with a capitalized B to say this is an object constructor and then set up my parameters here and they will be title, for the book title, see down here, book title, then comma, author, comma ISBN and finally, publication year. Now you'll notice that names used down here do not match the ones up here, that's because we're working inside the object constructor now and I can give it whatever names I want. So I want to be very clear about what these things are. So, title, author, ISBN and publication…
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.
Inhalt
-
-
-
-
-
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
-
-
-
-
-
-
-
-
-