en.javascript.info/1-js/8-oop/5-functional-inheritance/5-override-disable/task.md
Ilya Kantor 87bf53d076 update
2014-11-16 01:40:20 +03:00

17 lines
571 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Переопределите disable
[importance 5]
Переопределите метод `disable` холодильника, чтобы при наличии в нём еды он выдавал ошибку.
Код для проверки:
```js
var fridge = new Fridge(500);
fridge.enable();
fridge.addFood("кус-кус");
fridge.disable(); // ошибка, в холодильнике есть еда
```
В качестве исходного кода используйте решение [предыдущей задачи](/task/add-methods-fridge).