{"id":2591,"date":"2022-06-13T22:35:01","date_gmt":"2022-06-14T02:35:01","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/?p=2591"},"modified":"2022-06-13T22:35:01","modified_gmt":"2022-06-14T02:35:01","slug":"figuring-out-functions","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/2022\/06\/13\/figuring-out-functions\/","title":{"rendered":"Figuring out Functions"},"content":{"rendered":"<p>Functions are one of the fundamental building blocks in JavaScript. To use a function, you must define it somewhere in the scope in which you would like to call it.\u00a0<\/p>\n<p>A function statement consists of the &#8220;function&#8221; keyword, followed by the: name of the function; a list of parameters to the function, closed in by parentheses and separated by commas; the statements that define the function, enclosed in curly brackets.\u00a0<\/p>\n<p>Below is a visual summary of a basic function:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2592\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/function-300x129.png\" alt=\"\" width=\"300\" height=\"129\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/function-300x129.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/files\/2022\/06\/function.png 421w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The function &#8220;square&#8221; takes on parameter, called &#8220;number&#8221;. The function &#8220;square&#8221; consists of one statement that says to return the parameter of the function (&#8220;number&#8221; * &#8220;number&#8221;). The statement &#8220;return&#8221; specifies the value returned by the function.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Functions are one of the fundamental building blocks in JavaScript. To use a function, you must define it somewhere in the scope in which you would like to call it.\u00a0 A function statement consists of the &#8220;function&#8221; keyword, followed by the: name of the function; a list of parameters to the function, closed in by [&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-2591","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\/2591","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=2591"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2591\/revisions"}],"predecessor-version":[{"id":2593,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/posts\/2591\/revisions\/2593"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/media?parent=2591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/categories?post=2591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec712summer2022\/wp-json\/wp\/v2\/tags?post=2591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}