{"id":53407,"date":"2021-09-25T14:07:11","date_gmt":"2021-09-25T14:07:11","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/09\/25\/js-array-and-loop\/"},"modified":"2021-09-25T14:07:11","modified_gmt":"2021-09-25T14:07:11","slug":"js-array-and-loop","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/09\/25\/js-array-and-loop\/","title":{"rendered":"JS array and loop"},"content":{"rendered":"<p>Script 1: create a JavaScript program that defines, as an array, a list of 10 of your favorite things. <br \/>Then, using any loop that you wish (i.e. for, forEach, do\/while, etc) print each item from the array to the console. <br \/>Script 2: with the same script, add an if statement to test if you are on item #3, if so, print out &#8220;Wonderful, made it to item 3!&#8221;, and then continue with the loop as normal. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Script 1: create a JavaScript program that defines, as an array, a list of 10 of your favorite things. Then, using any loop that you wish (i.e. for, forEach, do\/while, etc) print each item from the array to the console. Script 2: with the same script, add an if statement to test if you are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-53407","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/53407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=53407"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/53407\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=53407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=53407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=53407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}