Browse Source

HW<6> done

Polina-Kob 2 years ago
parent
commit
003fdf16e5
1 changed files with 23 additions and 8 deletions
  1. 23 8
      js-06/index.html

+ 23 - 8
js-06/index.html

@@ -113,15 +113,30 @@
         //Union declarative
        
         let sample2 = {
-            a: a(),
-            cube: cube(),
-            avg2: avg2(),
-            sum3: sum3(),
-            intRandom: intRandom(),
-            greetAll: greetAll(),
-            sum: sum(),
+            a(){
+                a("Привет")
+            },
+            cube() {
+                cube(3)
+            },
+            avg2() {
+                avg2(1 ,2)
+            },
+            sum3() {
+                sum3(5, 10, 100500)
+            },
+            intRandom() {
+                intRandom(-1, -1)
+            },
+            greetAll() {
+                greetAll("Superman", "SpiderMan")
+            },
+            sum() {
+                sum(10, 20, 40, 100)
+            },
         }
-        //alert(sample2[prompt("Введите название задания")]);
+        console.log(sample2[prompt("Введите название задания")]());
+        
         
     </script>
 </body>