{"id":3282,"date":"2023-02-27T11:09:36","date_gmt":"2023-02-27T16:09:36","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=3282"},"modified":"2023-02-27T11:09:36","modified_gmt":"2023-02-27T16:09:36","slug":"purpose-of-return-5b","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/02\/27\/purpose-of-return-5b\/","title":{"rendered":"Purpose of Return (5b)"},"content":{"rendered":"<p>The return function is the function that ends the execution and will return a value to the function caller. The purpose of the return function when coding is to end the execution of the return, and as I previously mentioned as well, returns the control to the calling function. Below I will provide an example of a return function as well:<\/p>\n<p>function multiplyTwonumbers(a,b) {<\/p>\n<p>var result = a * b;<\/p>\n<p><strong>return<\/strong> result;<\/p>\n<p>}<\/p>\n<p>the return function stops the execution of a function and will return the value from it as well. Above you can see an example I included, and show in the code where the return function was executed, which would return the value from the code.\u00a0<\/p>\n<p>After doing a little more research about the return function, I learned more about the definition of currying as well. Currying is defined as, the transformation of a function with multiple arguments that is put into a sequence in a single-argument function. This means that you can have multiple step functions, but when using the return function, you do not have to go all the way back in your steps to figure out what passed that was able to return the function. After reading this new term, I was intrigued to know the benefits that a return function can also have.\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3283\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/02\/Screen-Shot-2023-02-27-at-11.08.36-AM.png\" alt=\"\" width=\"872\" height=\"520\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/02\/Screen-Shot-2023-02-27-at-11.08.36-AM.png 872w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/02\/Screen-Shot-2023-02-27-at-11.08.36-AM-300x179.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/02\/Screen-Shot-2023-02-27-at-11.08.36-AM-768x458.png 768w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The return function is the function that ends the execution and will return a value to the function caller. The purpose of the return function when coding is to end the execution of the return, and as I previously mentioned as well, returns the control to the calling function. Below I will provide an example [&hellip;]<\/p>\n","protected":false},"author":29246,"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":[10531],"tags":[845101,845093],"class_list":["post-3282","post","type-post","status-publish","format-standard","category-student-post","tag-return-function","tag-return-keyword","entry"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3282","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\/29246"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=3282"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3282\/revisions"}],"predecessor-version":[{"id":3284,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3282\/revisions\/3284"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=3282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=3282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=3282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}