Click in order · JavaScript and TypeScript course · Module 5: Advanced JavaScript

Key Element of the Builder Pattern

Arrange the elements of a Builder method that enables chaining:

Items to click

  • setDiet(diet) {
  • }
  • this.dinosaur.diet = diet;
  • return this;

You can check the correct answer by solving this task in the CodeWorlds game.