{"id":4301,"date":"2023-03-02T22:21:58","date_gmt":"2023-03-03T03:21:58","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=4301"},"modified":"2023-03-02T22:21:58","modified_gmt":"2023-03-03T03:21:58","slug":"if-else-statements-6a-2","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/if-else-statements-6a-2\/","title":{"rendered":"If\/Else Statements 6A"},"content":{"rendered":"<p>If and Else statements allow you to run code to find out if something is true or false. The simple statement to explain it is &#8220;If the condition is true, execute this code, else execute a different code. There are a number of operations you can test like:<\/p>\n<p>== equal to, &gt;= greater than or equal to, &gt; greater, != not equal<\/p>\n<p>An example of an if\/else statement is:<\/p>\n<p>let number = 2<\/p>\n<p>if (number &gt; 0) {<\/p>\n<p>console.log(true);<\/p>\n<p>}<\/p>\n<p>else if {<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4316 alignright\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/if-1.png\" alt=\"\" width=\"300\" height=\"168\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>console.log(false) ;<\/p>\n<p>}<\/p>\n<p>This statement would return the word &#8220;true&#8221; because 2 is greater than 0.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If and Else statements allow you to run code to find out if something is true or false. The simple statement to explain it is &#8220;If the condition is true, execute this code, else execute a different code. There are a number of operations you can test like: == equal to, &gt;= greater than or [&hellip;]<\/p>\n","protected":false},"author":29449,"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-4301","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\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/users\/29449"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=4301"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4301\/revisions"}],"predecessor-version":[{"id":4317,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4301\/revisions\/4317"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=4301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=4301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=4301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}