|
@@ -9,7 +9,7 @@
|
|
|
<body>
|
|
|
<script>
|
|
|
// -----------------------Анализ
|
|
|
-
|
|
|
+
|
|
|
function a(text) {
|
|
|
alert(text);
|
|
|
}
|
|
@@ -44,7 +44,7 @@
|
|
|
|
|
|
// -----------------------greetAll
|
|
|
|
|
|
- function greetAll(a, b) {
|
|
|
+ function greetAll() {
|
|
|
let arr = "";
|
|
|
if (arr != "") {
|
|
|
arr = "";
|
|
@@ -56,7 +56,6 @@
|
|
|
arr = arr.slice(0, -2);
|
|
|
console.log(arr);
|
|
|
alert("Hello " + arr + "!");
|
|
|
- return;
|
|
|
}
|
|
|
|
|
|
// ------------------------sum
|
|
@@ -121,16 +120,30 @@
|
|
|
// ------------------------Union declarative
|
|
|
|
|
|
let union = {
|
|
|
- a: aSample(),
|
|
|
- cube: cubeSample(),
|
|
|
- avg2: avg2Sample(),
|
|
|
- sum3: sum3Sample(),
|
|
|
- intRandom: intRandomSample(),
|
|
|
- greetAll: greetAllSample(),
|
|
|
- sum: sumSample(),
|
|
|
+ a () {
|
|
|
+ a("Hello")
|
|
|
+ },
|
|
|
+ cube () {
|
|
|
+ cube(10)
|
|
|
+ },
|
|
|
+ avg2 () {
|
|
|
+ avg2(20, 30)
|
|
|
+ },
|
|
|
+ sum3 () {
|
|
|
+ sum3(1, 2)
|
|
|
+ },
|
|
|
+ intRandom () {
|
|
|
+ intRandom(1, 10)
|
|
|
+ },
|
|
|
+ greetAll () {
|
|
|
+ greetAll("Anton", "Illia", "Andrey")
|
|
|
+ },
|
|
|
+ sum () {
|
|
|
+ sum(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
- console.log(union[prompt("Введите название задания")]);
|
|
|
+ console.log(union[prompt("Введите название задания")]());
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|