{"id":3798,"date":"2023-03-02T00:40:33","date_gmt":"2023-03-02T05:40:33","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=3798"},"modified":"2023-03-02T00:40:33","modified_gmt":"2023-03-02T05:40:33","slug":"discussion-6a-if-else-statements","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/discussion-6a-if-else-statements\/","title":{"rendered":"Discussion 6a If\/else Statements"},"content":{"rendered":"<p>Hello\u00a0everyone,<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-3811 alignleft\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/if_else-300x147.png\" alt=\"If\/else\" width=\"300\" height=\"147\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/if_else-300x147.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/if_else.png 320w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>If\/else statements change the way a code is run. When you start JavaScrip you can run a sequence of code as instructions to do certain things, when you add an if\/else statement into a code they run based on certain conditions. For example, true or false statements, if the response to a program is\u00a0true it may execute one thing and if it is false it will execute something else. These conditional statements are very useful when trying to see if a statement is true or false and allows you to ask this question within one operation. Another Boolean expression I want to talk about is Not a Number (NaN). The purpose of NaN is to see if a value is a number or not, this is important when you are working with strings. A string in JavaScript is used to sort text within a quote, it is also used to connect pieces of information. An example of a string would be \u2018Hello World&#8217;. A number example of a string is 1+2+ \u201c3\u201d= 33 because 3 is in quotes\u00a0it will be viewed as a string making the answer 33 instead of 6. \u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello\u00a0everyone, If\/else statements change the way a code is run. When you start JavaScrip you can run a sequence of code as instructions to do certain things, when you add an if\/else statement into a code they run based on certain conditions. For example, true or false statements, if the response to a program is\u00a0true [&hellip;]<\/p>\n","protected":false},"author":29447,"featured_media":3811,"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":[10531],"tags":[845022,845005,1050],"class_list":{"0":"post-3798","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-student-post","8":"tag-if-else","9":"tag-javascript","10":"tag-nan","11":"entry"},"jetpack_featured_media_url":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/if_else.png","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3798","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\/29447"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=3798"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3798\/revisions"}],"predecessor-version":[{"id":3812,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3798\/revisions\/3812"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media\/3811"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=3798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=3798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=3798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}