|
@@ -0,0 +1,153 @@
|
|
|
+// let body = {
|
|
|
+// tagName: 'body',
|
|
|
+// subTags: [{
|
|
|
+// tagName: 'div',
|
|
|
+// subTags: [{
|
|
|
+// tagName: 'span',
|
|
|
+// text: 'Enter a data please:',
|
|
|
+// tagName: '/br',
|
|
|
+// },{
|
|
|
+// tagName: 'input',
|
|
|
+// attrs: {
|
|
|
+// type: 'text',
|
|
|
+// id: 'name',
|
|
|
+// }
|
|
|
+// },{
|
|
|
+// tagName: 'input',
|
|
|
+// attrs: {
|
|
|
+// type: 'text',
|
|
|
+// id: 'surName',
|
|
|
+// }
|
|
|
+// }],
|
|
|
+// tagName: 'div',
|
|
|
+// subTags: [{
|
|
|
+// tagName: 'button',
|
|
|
+// text: 'OK',
|
|
|
+// attrs: {
|
|
|
+// id: 'ok',
|
|
|
+// }
|
|
|
+// },{
|
|
|
+// tagName: 'button',
|
|
|
+// text: 'Cancel',
|
|
|
+// attrs: {
|
|
|
+// id: 'cancel',
|
|
|
+// }
|
|
|
+// }]
|
|
|
+// }]
|
|
|
+// }
|
|
|
+//====================================================================================================//
|
|
|
+
|
|
|
+// declarative fields //
|
|
|
+
|
|
|
+
|
|
|
+// let notebook = {
|
|
|
+// brand: prompt('Enter a brad'),
|
|
|
+// type: prompt('Enter a type'),
|
|
|
+// model: prompt('Enter a model'),
|
|
|
+// ram: +prompt('Enter a ram'),
|
|
|
+// size: +prompt('Enter a size'),
|
|
|
+// weight: +prompt('Enter a weight'),
|
|
|
+// resolution: {
|
|
|
+// width: +prompt('Enter a width of resolution'),
|
|
|
+// height: +prompt('Enter a height of resolution'),
|
|
|
+// },
|
|
|
+// };
|
|
|
+
|
|
|
+// let phone = {
|
|
|
+// brand: prompt('Enter a brad'),
|
|
|
+// model: prompt('Enter a model'),
|
|
|
+// ram: +prompt('Enter a ram'),
|
|
|
+// color: prompt('Enter a color'),
|
|
|
+// };
|
|
|
+
|
|
|
+// let person = {
|
|
|
+// name: prompt('Enter your name'),
|
|
|
+// surname: prompt("Enter a surname"),
|
|
|
+// maried: confirm('Are you merried ?'),
|
|
|
+// smartphone: {
|
|
|
+// owner: '',
|
|
|
+// },
|
|
|
+// laptop: {
|
|
|
+// owner: '',
|
|
|
+// }
|
|
|
+// }
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// imperative array fill 3 //
|
|
|
+
|
|
|
+
|
|
|
+// let fio = [prompt('Enter your name'), prompt('Enter your surname'), prompt('Enter your fathersname')];
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// while confirm //
|
|
|
+
|
|
|
+
|
|
|
+// while (confirm) {
|
|
|
+// let confirmA = confirm('are you dumb ?');
|
|
|
+// if(confirmA == false) {
|
|
|
+// continue;
|
|
|
+// } else {
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// array fill //
|
|
|
+
|
|
|
+// let name = [];
|
|
|
+// while (true) {
|
|
|
+// let addName = prompt('Введите имя');
|
|
|
+// if (addName != null && addName != '') {
|
|
|
+// name.push(addName);
|
|
|
+// } else {
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+// let name = [];
|
|
|
+// let n = 0;
|
|
|
+// while (true) {
|
|
|
+// let addName = prompt('Введите имя');
|
|
|
+// if (addName != null && addName != '') {
|
|
|
+// name[n++] = (addName);
|
|
|
+// } else {
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// empty loop //
|
|
|
+// let ask = prompt('');
|
|
|
+// while (ask != null) {
|
|
|
+
|
|
|
+// }
|
|
|
+
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// infinite probability //
|
|
|
+
|
|
|
+// var a = 0;
|
|
|
+// while(true) {
|
|
|
+// a++;
|
|
|
+// if(Math.random() > 0.9) {
|
|
|
+// alert(a);
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// progression sum //
|
|
|
+
|
|
|
+ // не получается :(
|
|
|
+//=====================================================================================================//
|
|
|
+
|
|
|
+// chess one line //
|
|
|
+
|
|
|
+let i = '# ';
|
|
|
+let str = "";
|
|
|
+for (j=0;j<10;j++){
|
|
|
+ str += i;
|
|
|
+}
|
|
|
+console.log(str);
|