{"id":2562,"date":"2022-06-13T11:40:58","date_gmt":"2022-06-13T15:40:58","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/?p=2562"},"modified":"2022-06-13T11:40:58","modified_gmt":"2022-06-13T15:40:58","slug":"week-11-blog-post","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/2022\/06\/13\/week-11-blog-post\/","title":{"rendered":"week 11 blog post"},"content":{"rendered":"<p>In JavaScript we can use things called if\/else statements. These are used if there are more than one possible outcome of something. Similar to our English language, I could say &#8220;if you are 21 years old you can drink, or else you are too young.&#8221;. In our code we could similarly say this through writing out an if\/else statement. This would look something like:<\/p>\n<p>if(age&gt;=21) {<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0alert(&#8220;You are of age to drink!&#8221;);<\/p>\n<p>} else {<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0alert(&#8220;You are underage.&#8221;);<\/p>\n<p>}<\/p>\n<p>The whole basis of an if\/else statement is about making true\/false statements. It is writing in code something that has two outcomes or multiple if you put multiple together. It allows you to code out if one thing happens here is your outcome, and if not well this will happen. In my example, &#8220;&gt;=&#8221; means that when the first statement, &#8220;age&#8221;, is greater that or equal to &#8220;21&#8221;, then I tell you what would happen. And this lets us know that any age below 21 means you are underage and cannot drink alcohol.\u00a0<\/p>\n<p>There are many more symbols like that one to create meaning within our statements. An important one is &#8220;&amp;&amp;&#8221;. This is known as a logical operator that means that both our first and second statement are both going to be true. For example, saying something like I am 21 and I am over the age of 20 gives the same outcome that I am legal to drink. My two statements could be, &#8216;const a=21; const b&gt;20;&#8217;. We would use &amp;&amp; by stating &#8216;console.log(a=21 &amp;&amp; b&gt;20);&#8217; and that would create the same outcome as before &#8216;expected outcome(&#8220;You are of age to drink!&#8221;)&#8217;.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In JavaScript we can use things called if\/else statements. These are used if there are more than one possible outcome of something. Similar to our English language, I could say &#8220;if you are 21 years old you can drink, or else you are too young.&#8221;. In our code we could similarly say this through writing [&hellip;]<\/p>\n","protected":false},"author":26168,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[663943],"tags":[],"class_list":{"0":"post-2562","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-instructor","7":"entry"},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/users\/26168"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/comments?post=2562"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2562\/revisions"}],"predecessor-version":[{"id":2563,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2562\/revisions\/2563"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/media?parent=2562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/categories?post=2562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/tags?post=2562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}