{"id":3899,"date":"2023-03-02T14:41:14","date_gmt":"2023-03-02T19:41:14","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=3899"},"modified":"2023-03-02T14:41:30","modified_gmt":"2023-03-02T19:41:30","slug":"3899","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/3899\/","title":{"rendered":"The example of if\/else"},"content":{"rendered":"<p>We use if\/else to know what we want in the function. For example,<\/p>\n<p>&nbsp;<\/p>\n<p>Let num=10<\/p>\n<p>&nbsp;<\/p>\n<p>If (num&gt;0) {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Console.log(\u201cthe number is positive.\u201d)<\/p>\n<p>Else(num&lt;0)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Console.log(\u201cthe number is negative.\u201d)<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>In this function, we can easily know the answer is \u201cthe number is positive\u201d so we can quickly find out what the answer we want. Our code uses if\/else statements to take action in response to various scenarios. An if\/else statement can be used, for instance, to determine if a user is signed in before displaying certain content on a web page to them or to determine whether they have provided a valid password before granting them access to a system.<\/p>\n<p>&nbsp;<\/p>\n<p>Programmers use if\/else statements as a fundamental building block to create code that can respond intelligently to various inputs or circumstances. We may increase the adaptability, flexibility, and user-friendliness of our applications by employing if\/else statements.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We use if\/else to know what we want in the function. For example, &nbsp; Let num=10 &nbsp; If (num&gt;0) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Console.log(\u201cthe number is positive.\u201d) Else(num&lt;0) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Console.log(\u201cthe number is negative.\u201d) } &nbsp; In this function, we can easily know the answer is \u201cthe number is positive\u201d so we can quickly find out what the [&hellip;]<\/p>\n","protected":false},"author":29454,"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,10531,1],"tags":[],"class_list":{"0":"post-3899","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-instructor","7":"category-student-post","8":"category-uncategorized","9":"entry"},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3899","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\/29454"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=3899"}],"version-history":[{"count":2,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3899\/revisions"}],"predecessor-version":[{"id":3901,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3899\/revisions\/3901"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=3899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=3899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=3899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}