{"id":4038,"date":"2023-03-02T18:32:40","date_gmt":"2023-03-02T23:32:40","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=4038"},"modified":"2023-03-02T18:32:56","modified_gmt":"2023-03-02T23:32:56","slug":"5b-functions-in-js","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/5b-functions-in-js\/","title":{"rendered":"5b: Functions in JS"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4039 alignleft\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/functionsjs-300x198.png\" alt=\"\" width=\"300\" height=\"198\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/functionsjs-300x198.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/functionsjs.png 592w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><span style=\"font-weight: 400\">In JS, a function is a reusable block of code designed to perform a specific task to avoid having to reenter the same information over and over, creating a cleaner code and saving a lot of time. They can be executed as many times as needed.<\/span><\/p>\n<p><span style=\"font-weight: 400\">They are defined by the word \u2018function\u2019, followed <\/span><span style=\"font-weight: 400\">by whatever you wish to name the function, a set of parentheses (that contain the arguments for the function, however arguments are not necessary for the function to run), and then curly brackets that enclose the code to be executed. Once defined, a function can be used by entering the name and parentheses. The parentheses can be left blank if there are no arguments, but must contain a value if there are. Multiple arguments are separated by commas inside the parentheses.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In JS, a function is a reusable block of code designed to perform a specific task to avoid having to reenter the same information over and over, creating a cleaner code and saving a lot of time. They can be executed as many times as needed. They are defined by the word \u2018function\u2019, followed by [&hellip;]<\/p>\n","protected":false},"author":29253,"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-4038","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\/4038","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\/29253"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=4038"}],"version-history":[{"count":2,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4038\/revisions"}],"predecessor-version":[{"id":4041,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4038\/revisions\/4041"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=4038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=4038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=4038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}