{"id":1994,"date":"2021-05-24T19:26:41","date_gmt":"2021-05-24T19:26:41","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=1994"},"modified":"2021-05-24T19:26:41","modified_gmt":"2021-05-24T19:26:41","slug":"%d1%87%d1%82%d0%be-%d0%b4%d0%b5%d0%bb%d0%b0%d0%b5%d1%82-%d0%ba%d0%b0%d0%ba-%d0%b8-%d0%ba%d0%be%d0%b3%d0%b4%d0%b0-%d0%b8%d1%81%d0%bf%d0%be%d0%bb%d1%8c%d0%b7%d0%be%d0%b2%d0%b0%d1%82%d1%8c-%d0%bc%d0%b5","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=1994","title":{"rendered":"\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 find?"},"content":{"rendered":"\n<p>\u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043a \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u044e.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u0415\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0442\u0430\u043a\u043e\u0432:<br>let result = arr.find(function(item, index, array) {<br>\/\/ \u0435\u0441\u043b\u0438 true &#8211; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f<br>\/\/ \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043b\u043e\u0436\u043d\u044b\u043c\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f undefined<br>});<br>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<br>item \u2013 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<br>index \u2013 \u0435\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441.<br>array \u2013 \u0441\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n\n\n\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u044f id \u0438 name. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u0441 id == 1:<br>let users = [<br>{id: 1, name: &#8220;\u0412\u0430\u0441\u044f&#8221;},<br>{id: 2, name: &#8220;\u041f\u0435\u0442\u044f&#8221;},<br>{id: 3, name: &#8220;\u041c\u0430\u0448\u0430&#8221;}<br>];<\/p>\n\n\n\n<p>let user = users.find(item =&gt; <a href=\"http:\/\/item.id\/\" target=\"_blank\" rel=\"noreferrer noopener\">item.id<\/a> == 1);<br>alert(<a href=\"http:\/\/user.name\/\" target=\"_blank\" rel=\"noreferrer noopener\">user.name<\/a>); \/\/ \u0412\u0430\u0441\u044f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043a \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u044e.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[132],"tags":[],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1994"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1994"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1994\/revisions"}],"predecessor-version":[{"id":1995,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/1994\/revisions\/1995"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}