Created
July 14, 2022 18:49
-
-
Save evgeniyworkbel/6a05f5888b130d1844424a5b6faea801 to your computer and use it in GitHub Desktop.
Курс: "Введение в ООП" (Хекслет)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Circle.js | |
Реализуйте и экспортируйте по умолчанию класс Circle описывающий круг. У круга есть только одно свойство - его радиус. Реализуйте методы getArea() и getCircumference(), которые вычисляют и возвращают площадь и длину окружности соответственно. | |
Примеры | |
const circle = new Circle(3); | |
circle.getArea(); // 28.274... | |
Подсказки | |
Площадь круга: πr2 | |
Длина окружности: 2*πR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment