{"id":1662,"date":"2022-07-11T19:46:35","date_gmt":"2022-07-11T19:46:35","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=1662"},"modified":"2023-04-25T20:27:55","modified_gmt":"2023-04-25T20:27:55","slug":"continue-keyword-javascript","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/continue-keyword-javascript\/","title":{"rendered":"Continue Keyword Javascript"},"content":{"rendered":"<p style=\"text-align: center;\"><strong>Continue Keyword Javascript<\/strong><\/p>\n<p>The continue keyword is pretty interesting, and very useful as well. As the name of the keyword says, continue, which means that we are going to kind of skip the certain iteration. Well, let&#8217;s consider it casually, like if we are searching for only even numbers in the range, and if we find some odd number, we say continue, which means go to the next iteration because we have not found what we are searching for.<\/p>\n<h2 style=\"text-align: center;\">Continue Keyword Javascript<\/h2>\n<p><iframe loading=\"lazy\" title=\"Javascript Break and Continue | Lecture 31 | JavaScript for Beginners\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/Kyn33NsssLc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Let&#8217;s have a look at the below program, where we are using the continue keyword <a href=\"https:\/\/gyanipandit.com\/programming\/javascript\/\">Javascript<\/a>, and we are doing it when the value of i is 7(again we are doing it randomly). So, the loop is going to be printing the value from 0 to 6 onto the console, with no problem, and then the value of i is going to be 7, and the condition we have set is going to be true. This is the moment when the continue keyword executes. And, the entire thing for the value i = 7 is skipped. Let&#8217;s have a look at the program now &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-923 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/break-and-continue-keywords-2.jpg\" alt=\"\" width=\"391\" height=\"212\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/break-and-continue-keywords-2.jpg 391w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/break-and-continue-keywords-2-300x163.jpg 300w\" sizes=\"auto, (max-width: 391px) 100vw, 391px\" \/><br \/>\nAs you can see, in the above program, we have simply written a normal loop, where we are looping from the value 0 to 10(10 not included), and we have written a condition, where if the value of i becomes equal to 7, the continue keyword executes. So, this is like 1, 2, 3, 4, 5, 6, skip, 8, 9. and then we are out of the loop. This is amazing. Let&#8217;s have a look at the output now &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-924 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/break-and-continue-keywords-3.jpg\" alt=\"\" width=\"684\" height=\"327\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/break-and-continue-keywords-3.jpg 684w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/break-and-continue-keywords-3-300x143.jpg 300w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/p>\n<p>As you can see, the loop runs normally till the value 6. Once the value gets to 7, the continue keyword executes(we can simply understand it like we have skipped the iteration for this condition). So, we can see the output as skipped here, and then the values 8, and then 9, and then we are out of the loop.<\/p>\n<p>We can make use of the continue keyword <a href=\"https:\/\/www.youtube.com\/playlist?list=PLSvOEh55hdXVt5Jht4mjDJNTAuHKfPMAT\">Javascript<\/a>, as and when required. You can try practicing the programs involving the continue keyword, so as to become familiar with the concept.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continue Keyword Javascript The continue keyword is pretty interesting, and very useful as well. As the name of the keyword says, continue, which means that we are going to kind of skip the certain iteration. Well, let&#8217;s consider it casually, like if we are searching for only even numbers in the range, and if we [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,15],"class_list":{"0":"post-1662","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-javascript-tutorial","7":"tag-javascript","8":"tag-javascript-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/1662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=1662"}],"version-history":[{"count":3,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/1662\/revisions"}],"predecessor-version":[{"id":6085,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/1662\/revisions\/6085"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=1662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=1662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=1662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}