|
@@ -0,0 +1,118 @@
|
|
|
+// switch: sizes
|
|
|
+// let usSize = [
|
|
|
+// {
|
|
|
+// number: [6],
|
|
|
+// men: 'S',
|
|
|
+// woman:['XXS']
|
|
|
+// },
|
|
|
+// {
|
|
|
+// number: [8, 10],
|
|
|
+// men: 'M',
|
|
|
+// woman:['XXS', 'XS']
|
|
|
+// },
|
|
|
+// {
|
|
|
+// number: [12, 14],
|
|
|
+// men: 'L',
|
|
|
+// woman:['S', 'M']
|
|
|
+// },
|
|
|
+// {
|
|
|
+// number: [16, 18],
|
|
|
+// men: 'XL',
|
|
|
+// woman:['L','XL']
|
|
|
+// },
|
|
|
+// {
|
|
|
+// number: [20, 22],
|
|
|
+// men: 'XXL',
|
|
|
+// woman:['XXL', 'XXXL']
|
|
|
+// },
|
|
|
+// ]
|
|
|
+
|
|
|
+// let rusSize = prompt('Введите НАШ формат размера для переводa на на Американский формат','')
|
|
|
+
|
|
|
+// switch(+rusSize && +rusSize >= 40 && +rusSize <= 56) {
|
|
|
+// case true:
|
|
|
+// rusSize = +rusSize
|
|
|
+// let flag = 0
|
|
|
+
|
|
|
+// switch(rusSize % 2 !== 0) {
|
|
|
+// case true:
|
|
|
+// rusSize--
|
|
|
+// flag++
|
|
|
+// }
|
|
|
+
|
|
|
+// for(let i = 0; i < usSize.length; i++) {
|
|
|
+// let temp = usSize[i].number.findIndex(element => { return element === (rusSize - 34)})
|
|
|
+// switch( temp >= 0) {
|
|
|
+// case true:
|
|
|
+// alert(`
|
|
|
+// ${rusSize+flag}-й размер в американском формате:
|
|
|
+// +---------------------------------------+
|
|
|
+// Размер: ${usSize[i].number[temp]}
|
|
|
+// Мужчины: ${usSize[i].men}
|
|
|
+// Женщины: ${usSize[i].woman[temp]}
|
|
|
+// +---------------------------------------+
|
|
|
+// `)
|
|
|
+// i = usSize.length
|
|
|
+// break;
|
|
|
+
|
|
|
+// default:
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// break;
|
|
|
+
|
|
|
+// case false:
|
|
|
+// alert('Неправильный размер.')
|
|
|
+// break;
|
|
|
+// }
|
|
|
+
|
|
|
+//switch: if
|
|
|
+let color = prompt("Введите цвет","");
|
|
|
+// switch (color){
|
|
|
+// case "red": document.write("<div style='background-color: red;'>красный</div>");
|
|
|
+// case "black": document.write("<div style='background-color: black; color: white;'>черный</div>");
|
|
|
+// break;
|
|
|
+// case "blue": document.write("<div style='background-color: blue;'>синий</div>");
|
|
|
+// case "green": document.write("<div style='background-color: green;'>зеленый</div>");
|
|
|
+// break;
|
|
|
+// default: document.write("<div style='background-color: gray;'>Я не понял</div>");
|
|
|
+// }
|
|
|
+
|
|
|
+if(color === 'red') {
|
|
|
+ document.write("<div style='background-color: red;'>красный</div>");
|
|
|
+ document.write("<div style='background-color: black; color: white;'>черный</div>");
|
|
|
+} else if(color === 'blue') {
|
|
|
+ document.write("<div style='background-color: blue;'>синий</div>");
|
|
|
+ document.write("<div style='background-color: green;'>зеленый</div>");
|
|
|
+} else if(color === 'green') {
|
|
|
+ document.write("<div style='background-color: green;'>зеленый</div>");
|
|
|
+} else if(color === 'black') {
|
|
|
+ document.write("<div style='background-color: black; color: white;'>черный</div>");
|
|
|
+} else {
|
|
|
+ document.write("<div style='background-color: gray;'>Я не понял</div>");
|
|
|
+}
|
|
|
+
|
|
|
+//prompt: or
|
|
|
+let age = prompt('Введите свой возраст', '') || alert('Вы не ввели ничего!')
|
|
|
+if (age && isNaN(age) || age > 200 || age < 0){
|
|
|
+ alert('Вы ввели неверные данные!')
|
|
|
+} else if(age){
|
|
|
+ age = age = Math.trunc(Number(age))
|
|
|
+ res = new Date().getFullYear() - age
|
|
|
+ alert(`Исходя из введенного вами возраста вы родились в ${res}г. либо ${res-1}г.`)
|
|
|
+}
|
|
|
+
|
|
|
+//confirm: or this days
|
|
|
+confirm('шоппинг') || alert('ты-бяка')
|
|
|
+
|
|
|
+//confirm: if this days
|
|
|
+if(!confirm('шоппинг')) {
|
|
|
+ alert('ты-бяка')
|
|
|
+}
|
|
|
+
|
|
|
+//triple prompt
|
|
|
+let Name = prompt('your Name:','')
|
|
|
+let surname = prompt('your Surname:','')
|
|
|
+let fathersname = prompt('your Fathersname:','')
|
|
|
+alert(surname, fathersname, Name)
|
|
|
+
|