Bladeren bron

Homework.3

Marko 2 jaren geleden
bovenliggende
commit
06eb5fb959
1 gewijzigde bestanden met toevoegingen van 86 en 8 verwijderingen
  1. 86 8
      file.js

+ 86 - 8
file.js

@@ -49,14 +49,92 @@ let person = {
     married: confirm(),
 }
 
-// object links??
+// object links
 
 let person1 = {
-name: 'Marko',
-smartphone:{
-    owner:'Marko'}
-,
-leptop:{
-    owner:'Marko'}
+name:prompt('Enter a name'),
+smartphone:{ owner:person1},
+laptop:{ owner:person1}
 }
-person1.smartphone.owner.leptop.owner == person1.smartphone
+
+// imperative array fill 3
+
+let array = [];
+array[0] = +prompt();
+array[1] = +prompt();
+array[2] = +prompt();
+
+// while confirm
+
+let qvestion = '';
+while(qvestion != true){
+     qvestion = confirm('are you batman?')}
+
+
+// array fill
+
+let array1 = [];
+let filling = '';
+while(filling != null){
+    filling = prompt('введите число'),
+     array1.push(filling);
+}
+
+// array fill nopush\
+
+let array2 = [];
+let i = 0;
+let filling1 = '';
+while(filling1 != null){
+    filling1 = prompt('введите число')
+     array2[i] = filling1;
+     i++
+}
+
+// infinite probability(?)
+let a = Math.random()
+let b = 0
+while( a < 0.9){ 
+b + 1;
+break;
+}
+
+// empty loop
+
+let value = '';
+while(value != prompt());
+
+// progression sum
+
+let sum = 0;
+for(i = 1; i < 50; i+=3){
+    sum = sum + i}
+    console.log(sum);
+
+    // chess one line
+
+let c = '';
+for(y = 0;y < 21;y++){
+    if(y % 2 === 1){
+c = c + '#'} 
+    else {
+c = c + ' '}}
+
+
+// numbers(????)<
+
+let x = '';
+for(i=0;i<10;i++){
+    x = x + '0123456789\n'
+}
+console.log(x)
+
+// chess(??????????)
+
+// cubes(?????????)
+
+// multiply table(???????)
+
+// matrix to html table(????????)
+
+// не понял с этого задания>