|
@@ -98,10 +98,10 @@ console.log(body.subTags[1].subTags[1].text)
|
|
|
|
|
|
// var person = {
|
|
|
// smartphone: {
|
|
|
-// owner: prompt("enter smartphone owner"),
|
|
|
+// owner: person,
|
|
|
// },
|
|
|
// laptop: {
|
|
|
-// owner: prompt("enter laptop owner"),
|
|
|
+// owner: person,
|
|
|
// }
|
|
|
// };
|
|
|
|
|
@@ -128,23 +128,28 @@ console.log(body.subTags[1].subTags[1].text)
|
|
|
//array fill//////////////////////////////////////////////////
|
|
|
// let arr1 = []
|
|
|
// let box;
|
|
|
-// do {
|
|
|
+// while (box !== null) {
|
|
|
// box = prompt("ok?");
|
|
|
// arr1.push(box)
|
|
|
+// if (box === null) {
|
|
|
+// break;
|
|
|
+// }
|
|
|
// }
|
|
|
-// while (box !== null)
|
|
|
|
|
|
|
|
|
// array fill nopush//////////////////////////////////////////
|
|
|
// let arr1 = []
|
|
|
// i = 0;
|
|
|
// let box;
|
|
|
-// do {
|
|
|
+// while (box !== null) {
|
|
|
// box = prompt("ok?");
|
|
|
// arr1[i] = box;
|
|
|
// i++
|
|
|
+// if (box === null) {
|
|
|
+// break;
|
|
|
+// }
|
|
|
// }
|
|
|
-// while (box !== null)
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -170,10 +175,13 @@ console.log(body.subTags[1].subTags[1].text)
|
|
|
|
|
|
// empty loop////////////////////////////////////////////////
|
|
|
// let box;
|
|
|
-// do {
|
|
|
-// box = prompt("ok?");
|
|
|
+// while (box !== "") {
|
|
|
+// box = prompt("enter")
|
|
|
+// if (box === "") {
|
|
|
+// break
|
|
|
+// }
|
|
|
// }
|
|
|
-// while (box !== "")
|
|
|
+
|
|
|
|
|
|
|
|
|
// progression sum//////////////////////////////////////////
|
|
@@ -221,17 +229,12 @@ console.log(body.subTags[1].subTags[1].text)
|
|
|
|
|
|
// chess/////////////////////////////////////////////////////
|
|
|
// let str = "";
|
|
|
-// for (let i = 0; i < 5; i++) {
|
|
|
+// for (let i = 0; i < 7; i++) {
|
|
|
// str += "\n";
|
|
|
-// for (a = 0; a < 12; a++) {
|
|
|
-// if (a % 2 === 0) str += ".";
|
|
|
+// for (a = 0; a < 7; a++) {
|
|
|
+// if ((a + i) % 2 === 0) str += ".";
|
|
|
// else str += "#";
|
|
|
// }
|
|
|
-// str += "\n";
|
|
|
-// for (a = 0; a < 12; a++) {
|
|
|
-// if (a % 2 === 0) str += "#";
|
|
|
-// else str += ".";
|
|
|
-// }
|
|
|
// }
|
|
|
// console.log(str);
|
|
|
|
|
@@ -256,3 +259,7 @@ console.log(body.subTags[1].subTags[1].text)
|
|
|
// alert(arr[7][2]);
|
|
|
|
|
|
// matrix to html table////////////////////////////////////
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|