Browse Source

<HW6>fix done

Mark 1 year ago
parent
commit
7ec9739b5e
1 changed files with 4 additions and 7 deletions
  1. 4 7
      06/main.js

+ 4 - 7
06/main.js

@@ -1,12 +1,12 @@
 // a
 function a() {
-   alert('Привет');
+   return alert('Привет');
 }
 a()
 
 // cube
 function cube() {
-   console.log(prompt('number') ** 3);
+   return console.log(prompt('number') ** 3);
 }
 cube()
 
@@ -14,7 +14,7 @@ cube()
 function avg2() {
    let a = +prompt('num1')
    let b = +prompt('num2')
-   console.log((a + b) / 2);
+   return console.log((a + b) / 2);
 }
 avg2()
 // avg2(5, 10)
@@ -29,7 +29,6 @@ function sum3(a, b, c) {
    b = +prompt('num2')
    c = +prompt('num3')
    return console.log(a + b + c);
-
 }
 sum3()
 
@@ -64,9 +63,7 @@ intRandom()
 
 // greetAll
 function greetAll(...arguments) {
-   for (let arg of arguments) {
-      alert(`Hello ${arg}!`)
-   }
+   alert(`Hello ${arguments}!`)
 }
 greetAll("Superman")
 greetAll("Superman", "SpiderMan")