{"id":4126,"date":"2023-03-02T21:11:50","date_gmt":"2023-03-03T02:11:50","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=4126"},"modified":"2023-03-02T21:14:44","modified_gmt":"2023-03-03T02:14:44","slug":"6b-post-loops-in-javascript","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/6b-post-loops-in-javascript\/","title":{"rendered":"6b Post (Loops in JavaScript)"},"content":{"rendered":"<p>Loops are very important to use in Javascript. Loops are used to repeat a block of code. It makes it easier to loop the code instead of writing the same code over and over again. Its repeats the block of code until a condition causes it to end. Its important because performs tasks quickly. The &#8220;For&#8221; Loop is used when we want the code to run a specific number of times. The syntax for the &#8220;for&#8221; loop is\u00a0 <em>for (int i=start_value; i &lt; finish_value; i = i + by_count )<\/em><em>{ <\/em><em>do something<\/em><em>}<\/em>(utah.edu)<em>. <\/em>There are three parts of a for loop. They are the keyword [for] that begins the loop, the condition that is being tested, and the keyword [for] that ends the loop (freedomscience.com). When we don&#8217;t have a specific number of times for the code to run, the while loop will be used. The code will run until a condition is met.\u00a0 The syntax for the while loop is <em>while ( condition is true ) <\/em><em>do something <\/em><em>% Note: the &#8220;something&#8221; should eventually result <\/em><em>% in the condition being false <\/em><em>end.\u00a0<\/em>(utah.edu)<\/p>\n<p><i>9.7 Looping<\/i>. Freedom Scientific. (n.d.). Retrieved March 2, 2023, from https:\/\/support.freedomscientific.com\/Content\/Documents\/Other\/ScriptManual\/09-7_Looping.htm#:~:text=Similar%20to%20a%20While%20loop,keyword%20that%20terminates%20the%20loop.<\/p>\n<p>Germain, H. J. de S. (n.d.). <i>For loop<\/i>. Programming &#8211; For Loop. Retrieved March 2, 2023, from https:\/\/users.cs.utah.edu\/~germain\/PPS\/Topics\/for_loops.html<\/p>\n<p>Germain, H. J. de S. (n.d.). <i>The &#8220;while&#8221; loop<\/i>. Programming &#8211; While Loop. Retrieved March 2, 2023, from https:\/\/users.cs.utah.edu\/~germain\/PPS\/Topics\/while_loops.html<\/p>\n<div>\n<p>&nbsp;<\/p>\n<div>\u00a0<\/div>\n<\/div>\n<pre class=\"code\">\u00a0<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Loops are very important to use in Javascript. Loops are used to repeat a block of code. It makes it easier to loop the code instead of writing the same code over and over again. Its repeats the block of code until a condition causes it to end. Its important because performs tasks quickly. The [&hellip;]<\/p>\n","protected":false},"author":29250,"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":[709528,845102,845005,845006,178,845115],"class_list":{"0":"post-4126","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-student-post","7":"tag-coding","8":"tag-for-loop","9":"tag-javascript","10":"tag-loops","11":"tag-mis","12":"tag-while-loop","13":"entry"},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4126","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\/29250"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=4126"}],"version-history":[{"count":2,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4126\/revisions"}],"predecessor-version":[{"id":4250,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4126\/revisions\/4250"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=4126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=4126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=4126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}