{"id":7940,"date":"2021-06-27T20:30:22","date_gmt":"2021-06-27T17:30:22","guid":{"rendered":"https:\/\/elzero.org\/?p=7940"},"modified":"2022-10-27T19:01:31","modified_gmt":"2022-10-27T16:01:31","slug":"if-and-switch-toggle-challenge","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/if-and-switch-toggle-challenge\/","title":{"rendered":"If And Switch Toggle"},"content":{"rendered":"<h3>\u0645\u0642\u062f\u0645\u0629 \u0639\u0646 \u0627\u0644\u062a\u062d\u062f\u064a<\/h3>\r\n\r\n<div class=\"text\">\r\n\u0642\u0645 \u0628\u062a\u062d\u0648\u064a\u0644 \u0627\u0644 Switch Statement \u0644 If Condition \u0648\u0627\u0644\u0639\u0643\u0633 \r\n<\/div>\r\n\r\n<h3>\u0645\u062b\u0627\u0644 \u0639\u0644\u0649 \u0627\u0644\u0637\u0644\u0628 \u0627\u0644\u0623\u0648\u0644 \u0628\u0648\u0627\u0633\u0637\u0629 \u0644\u063a\u0629 JavaScript<\/h3>\r\n\r\n<div class=\"text\">\r\n\u0642\u0645 \u0628\u062a\u062d\u0648\u064a\u0644 \u0627\u0644 Code \u0627\u0644\u062a\u0627\u0644\u064a \u0644 Switch Statement \u0644\u064a\u0642\u0648\u0645 \u0628\u0646\u0641\u0633 \u0639\u0645\u0644 \u0627\u0644 Code \u062a\u0645\u0627\u0645\u0627\r\n<\/div>\r\n\r\n<script type=\"text\/plain\" class=\"language-javascript\">\r\nlet job = \"Manager\";\r\nlet salary = 0;\r\n\r\nif (job === \"Manager\") {\r\n  salary = 8000;\r\n} else if (job === \"IT\" || job === \"Support\") {\r\n  salary = 6000;\r\n} else if (job === \"Developer\" || job === \"Designer\") {\r\n  salary = 7000;\r\n} else {\r\n  salary = 4000;\r\n}\r\n<\/script>\r\n\r\n<h3>\u0645\u062b\u0627\u0644 \u0639\u0644\u0649 \u0627\u0644\u0637\u0644\u0628 \u0627\u0644\u062b\u0627\u0646\u064a \u0628\u0648\u0627\u0633\u0637\u0629 \u0644\u063a\u0629 JavaScript<\/h3>\r\n\r\n<div class=\"text\">\r\n\u0642\u0645 \u0628\u062a\u062d\u0648\u064a\u0644 \u0627\u0644 Code \u0627\u0644\u062a\u0627\u0644\u064a \u0644 If Condition \u0644\u064a\u0642\u0648\u0645 \u0628\u0646\u0641\u0633 \u0639\u0645\u0644 \u0627\u0644 Code \u062a\u0645\u0627\u0645\u0627\r\n<\/div>\r\n\r\n<script type=\"text\/plain\" class=\"language-javascript\">\r\nlet holidays = 0;\r\nlet money = 0;\r\n\r\nswitch (holidays) {\r\n  case 0:\r\n    money = 5000;\r\n    console.log(`My Money is ${money}`);\r\n    break;\r\n  case 1:\r\n  case 2:\r\n    money = 3000;\r\n    console.log(`My Money is ${money}`);\r\n    break;\r\n  case 3:\r\n    money = 2000;\r\n    console.log(`My Money is ${money}`);\r\n    break;\r\n  case 4:\r\n    money = 1000;\r\n    console.log(`My Money is ${money}`);\r\n    break;\r\n  case 5:\r\n    money = 0;\r\n    console.log(`My Money is ${money}`);\r\n    break;\r\n  default:\r\n    money = 0;\r\n    console.log(`My Money is ${money}`);\r\n}\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>If And Switch Toggle<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[882],"tags":[],"class_list":["post-7940","post","type-post","status-publish","format-standard","hentry","category-programming-challenges"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/7940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=7940"}],"version-history":[{"count":3,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/7940\/revisions"}],"predecessor-version":[{"id":12455,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/7940\/revisions\/12455"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=7940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=7940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=7940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}