{"id":2607,"date":"2022-06-14T17:26:26","date_gmt":"2022-06-14T21:26:26","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/?p=2607"},"modified":"2022-06-14T17:26:26","modified_gmt":"2022-06-14T21:26:26","slug":"if-else-statements","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/2022\/06\/14\/if-else-statements\/","title":{"rendered":"if else statements"},"content":{"rendered":"<p>An if else statement is a way of checking something in your JavaScript code. I we want to know if a number is equal to 5, we can use an if else statement. If we were to be speaking this in English, and not in JavaScript, it would sound like: if this number is equal to 5 then do something, if not then do something else. I JavaScript it would look like:\u00a0<\/p>\n<p>In the example below our &#8220;5&#8221; is a &#8220;10&#8221;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-2608\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/if-else-300x60.png\" alt=\"\" width=\"615\" height=\"123\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/if-else-300x60.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/if-else-768x155.png 768w, https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/if-else.png 1003w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/p>\n<p>This code consists of four parts. 1) line one is the if statement. 2) &#8220;thisNumber == 10&#8221; is the Boolean expression. 3) &#8220;==&#8221; is the operator. 4) else statement is in line three.<\/p>\n<p>An else statement is not necessary. You could just have an if statement, or several if statement in a row.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An if else statement is a way of checking something in your JavaScript code. I we want to know if a number is equal to 5, we can use an if else statement. If we were to be speaking this in English, and not in JavaScript, it would sound like: if this number is equal [&hellip;]<\/p>\n","protected":false},"author":28304,"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-2607","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\/2607","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\/28304"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/comments?post=2607"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2607\/revisions"}],"predecessor-version":[{"id":2609,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2607\/revisions\/2609"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/media?parent=2607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/categories?post=2607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/tags?post=2607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}