Browse Source

<HW2>upd done

Mark 2 years ago
parent
commit
8c8aca6521
1 changed files with 17 additions and 0 deletions
  1. 17 0
      02/main.js

+ 17 - 0
02/main.js

@@ -159,6 +159,23 @@ else if (size = 54) {
 }
 
 
+//Comparison: object/////////////////////////////////////////////////////
+let size = +prompt('enter ukr size', "");
+let size2;
+let size1 = {
+   number40: '6(S)',
+   number42: '8(M)',
+   number44: '10',
+   number46: '12(L)',
+   number48: '14',
+   number50: '16(XL)',
+   number52: '18',
+   number54: '20(XXL)',
+
+}
+size2 = size1[`number${size}`]
+alert(`us size = ${size2}`)
+
 
 //Ternary///////////////////////////////////////////////////////////////
 let text = confirm('вы мужчина?') ? alert('вы мужчина') : alert('вы женщина');