소스 검색

HW5 done without BlackBelt

maryluis 4 년 전
부모
커밋
5107f7e69e
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      homework5js/script.js

+ 9 - 3
homework5js/script.js

@@ -107,16 +107,22 @@ function declarativeFriends() {
 //////////////
 
 
-/////
+/////Я толком не поняла что имеется ввиду, потому написала два варианта, надеюсь хоть один из них верный.
 /////imperative array fill 3
-debugger
 function imperativeArray() {
     let imperative = [];
     imperative[0] = prompt("How old are you?"), imperative[1] = prompt("How old is your father?"), imperative[2] = prompt("How old is your mother?")
     alert("So you are " + imperative[0] + " years old. Your father is " + imperative[1] + " and mother is " + imperative[2])
 }
-imperativeArray()
+// imperativeArray()
 ////////
+function imperativeArray2() {
+    var imperative = [];
+    imperative.push((prompt("How old are you?")),(prompt("How old is your father?")), (prompt("How old is your father?")));
+    alert("So you are " + imperative[0] + " years old. Your father is " + imperative[1] + " and mother is " + imperative[2])
+}
+// imperativeArray2()
+
 
 
 //////