Object-Oriented JavaScript

Objects in JavaScript are everywhere. Whether you know it or not, you've been using them already. You can use the document object to find HTML elements and modify their contents. You've been using the console to log out values. However, you can make your own objects to organize your own code and do some awesome things. In this course we'll build a couple of projects to get a handle on creating your own objects.

What you'll learn

  • Create your own objects with methods
  • Use constructors
  • Creating prototypes
  • Use prototypal inheritance

Introduction to Methods

Objects are great programming tools. They can be used to encapsulate information about a particular thing without creating multiple variables. They can also encapsulate behavior or functionality in the form of methods.

  • Different Kinds of Objects7:15
  • Different Kinds of Objects6 questions
  • Object Literal Review2:25
  • Object Literal Review3 questions
  • Create an Object Literal2 objectives
  • Adding a Method to an Object2:55
  • Adding a Method to an Object2 objectives
  • Understanding this4:24
  • Understanding this2 objectives
  • Returning Values2:40
  • Returning Values1 objective
  • Modifying Objects with Methods3:45
  • Finishing the Calculator3 objectives

Constructor Functions and Prototypes

Object literals aren't suited for all situations. There are times where you want to make many instances of a given type of thing. We can do that by using constructor functions and share behavior with prototypes.

  • Creating Multiple Instances with Constructors3:57
  • Constructors Review3 questions
  • Make a Constructor Challenge0:20
  • Challenge Solution0:37
  • Create a Constructor3 objectives
  • Methods with Prototypes5:09
  • Adding a Prototype1 objective
  • Playlist Project6:53
  • Making the UI Work8:02
  • Prototypes Review3 questions

Prototypal Inheritance

If you have similar types of objects with similar behaviors, duplicating the same code between the prototypes can make your code harder to maintain. JavaScript has a way of allowing you to share functionality between prototypes using a technique called Prototypal Inheritance.

  • Prototype Chain1:51
  • Building the Media Object1:36
  • Updating the Song Object3:07
  • Setting Up the Prototype Chain2 objectives
  • Building the Movie Object2:54
  • Prototypal Inheritance Review5 questions

Practice Project

In this stage you'll be tasked with creating an interactive Quiz application.

You'll be given everything you need and don't worry I'll be here to help you along if you get stuck.

  • Project Overview2:34
  • Question Prototype0:51
  • Quiz Prototype2:02
  • User Interface Code3:56
  • Object-Oriented JavaScript Review10 questions

results matching ""

    No results matching ""