freeCodeCamp/curriculum/challenges/russian/02-javascript-algorithms-an.../object-oriented-programming/use-a-mixin-to-add-common-b...

1.6 KiB

id title challengeType videoUrl localeTitle
587d7db2367417b2b2512b89 Use a Mixin to Add Common Behavior Between Unrelated Objects 1 Использование Mixin для добавления общего поведения между несвязанными объектами

Description

undefined

Instructions

undefined

Tests

tests:
  - text: Ваш код должен объявить переменную <code>glideMixin</code> которая является функцией.
    testString: 'assert(typeof glideMixin === "function", "Your code should declare a <code>glideMixin</code> variable that is a function.");'
  - text: ''
    testString: 'assert(typeof bird.glide === "function", "Your code should use the <code>glideMixin</code> on the <code>bird</code> object to give it the <code>glide</code> method.");'
  - text: Ваш код должен использовать <code>glideMixin</code> на объекте <code>boat</code> чтобы придать ему метод <code>glide</code> .
    testString: 'assert(typeof boat.glide === "function", "Your code should use the <code>glideMixin</code> on the <code>boat</code> object to give it the <code>glide</code> method.");'

Challenge Seed

let bird = {
  name: "Donald",
  numLegs: 2
};

let boat = {
  name: "Warrior",
  type: "race-boat"
};

// Add your code below this line

Solution

// solution required