{"id":1671,"date":"2019-09-04T19:57:34","date_gmt":"2019-09-05T02:57:34","guid":{"rendered":"https:\/\/doubleecpu.com\/?page_id=1671"},"modified":"2019-09-13T11:06:31","modified_gmt":"2019-09-13T18:06:31","slug":"myarrays2","status":"publish","type":"page","link":"https:\/\/doubleecpu.com\/index.php\/raspian-linux-programs\/javascript-2\/myjs30\/myarrays2\/","title":{"rendered":"myArrays2"},"content":{"rendered":"\n<div>\n<label>{isAdult}<\/label>\n<\/div>\n<script><br \/>\n    \/\/ ## Array Cardio Day 2<br \/>\n    const people = [<br \/>\n      { name: 'Wes', year: 1988 },<br \/>\n      { name: 'Kait', year: 1986 },<br \/>\n      { name: 'Irv', year: 1970 },<br \/>\n      { name: 'Lux', year: 2015 }<br \/>\n    ];<br \/>\n    const comments = [<br \/>\n      { text: 'Love this!', id: 523423 },<br \/>\n      { text: 'Super good', id: 823423 },<br \/>\n      { text: 'You are the best', id: 2039842 },<br \/>\n      { text: 'Ramen is my fav food ever', id: 123523 },<br \/>\n      { text: 'Nice Nice Nice!', id: 542328 }<br \/>\n    ];<br \/>\n    \/\/ Some and Every Checks<br \/>\n    \/\/ Array.prototype.some() \/\/ is at least one person 19 or older?<br \/>\nconst isAdult = people.some(person => (new Date()).getfullyear()) - person.year >= 19<br \/>\nconsole.log({isAdult})\n<\/p>\n<p>    \/\/ Array.prototype.every() \/\/ is everyone 19 or older?<br \/>\nconst allAdults = people.every(person => (new Date()).getfullyear()) - person.year >= 19<br \/>\nconsole.log({allAdults})<br \/>\n    \/\/ Array.prototype.find()<br \/>\n    \/\/ Find is like filter, but instead returns just the one you are looking for<br \/>\n    \/\/ find the comment with the ID of 823423<br \/>\n    \/\/ Array.prototype.findIndex()<br \/>\n    \/\/ Find the comment with this ID<br \/>\n    \/\/ delete the comment with the ID of 823423<br \/>\n  <\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>{isAdult}<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1022,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1671","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/1671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/comments?post=1671"}],"version-history":[{"count":1,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/1671\/revisions"}],"predecessor-version":[{"id":2411,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/1671\/revisions\/2411"}],"up":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/1022"}],"wp:attachment":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/media?parent=1671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}