{"id":1771,"date":"2021-09-11T06:01:37","date_gmt":"2021-09-10T21:01:37","guid":{"rendered":"http:\/\/www.agile-software.site\/?p=1771"},"modified":"2022-10-30T19:35:25","modified_gmt":"2022-10-30T10:35:25","slug":"map%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=1771","title":{"rendered":"map\u30e1\u30bd\u30c3\u30c9"},"content":{"rendered":"\n<p>map\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066for\u6587\u306a\u3069\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u4f7f\u308f\u305a\u3068\u3082\u3059\u3079\u3066\u306e\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\/\/ \u30a2\u30ed\u30fc\u95a2\u6570\nmap((element, index, array) =&gt; { \/* \u2026 *\/ })\n\n\/\/ \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\nmap(\u95a2\u6570.\u30a4\u30c6\u30e9\u30d6\u30eb)\n\n\/\/ \u30a4\u30f3\u30e9\u30a4\u30f3\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">push\u30e1\u30bd\u30c3\u30c9<\/h2>\n\n\n\n<p>\u914d\u5217\u306e\u6700\u5f8c\u306b\u65b0\u3057\u3044\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u30e1\u30bd\u30c3\u30c9<\/p>\n\n\n\n<div class=\"wp-block-jin-gb-block-icon-box jin-icon-caution jin-iconbox\"><div class=\"jin-iconbox-icons\"><i class=\"jic jin-ifont-caution jin-icons\"><\/i><\/div><div class=\"jin-iconbox-main\">\n<p>\u30a4\u30c6\u30e9\u30d6\u30eb\uff1alist\u3084range\u95a2\u6570\u306e\u3088\u3046\u306afor\u6587\u306ein\u306e\u5f8c\u306b\u66f8\u3051\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3002\u30a4\u30c6\u30e9\u30d6\u30eb\u306e\u3059\u3079\u3066\u306e\u8981\u7d20\u306b\u7b2c\u4e00\u5f15\u6570\u3067\u8a2d\u5b9a\u3057\u305f\u95a2\u6570\u3092\u9069\u5fdc\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">forEach\u30e1\u30bd\u30c3\u30c9<\/h2>\n\n\n\n<p>\u914d\u5217\u306e\u4e2d\u306e\u8981\u7d20\u30921\u3064\u305a\u3064\u53d6\u308a\u51fa\u3057\u3066\u3059\u3079\u3066\u306e\u8981\u7d20\u306b\u540c\u3058\u51e6\u7406\u3092\u884c\u3046<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8981\u7d201\u304c\u5165\u308b<\/li><li>\u8981\u7d201\u306b\u5bfe\u3057\u3066\u51e6\u7406<\/li><\/ul>\n\n\n\n<div class=\"wp-block-jin-gb-block-icon-box jin-icon-star jin-iconbox\"><div class=\"jin-iconbox-icons\"><i class=\"jic jin-ifont-star jin-icons\"><\/i><\/div><div class=\"jin-iconbox-main\">\n<p>\u914d\u5217.forEach((\u5f15\u6570) =&gt; {\u51e6\u7406});<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>const numbers = [1,2,3];\n\nnumbers.forEach((number) =&gt; {console.log(number);});<\/code><\/pre><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>1\n2\n3<\/code><\/pre><\/div>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">find\u30e1\u30bd\u30c3\u30c9<\/h2>\n\n\n\n<p>\u914d\u5217\u306e\u8981\u7d20\u304c1\u3064\u305a\u3064\u5f15\u6570\u306b\u4ee3\u5165\u3055\u308c\u3066\u51e6\u7406\u304c\u9032\u3080<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">fill()\u30e1\u30bd\u30c3\u30c9<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>fill(value, start, end)\n\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>value:\u914d\u5217\u306b\u8a2d\u5b9a\u3059\u308b\u5024\u3067\u3059\u3002<\/li><li>start:\u958b\u59cb\u3059\u308b\u4f4d\u7f6e\u3067\u3059\u3002\u65e2\u5b9a\u5024\u306f\u00a0<code>0<\/code>\u00a0\u3067\u3059\u3002<\/li><li>end:\u7d42\u4e86\u3059\u308b\u4f4d\u7f6e\u3067\u3059\u3002\u65e2\u5b9a\u5024\u306f\u00a0<code>arr.length<\/code>\u00a0\u3067\u3059\u3002<\/li><\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>const array1 = [1, 2, 3, 4];\n\n\/\/ fill with 0 from position 2 until position 4\nconsole.log(array1.fill(0, 2, 4));\n\/\/ expected output: [1, 2, 0, 0]\n\n\/\/ fill with 5 from position 1\nconsole.log(array1.fill(5, 1));\n\/\/ expected output: [1, 5, 5, 5]\n\nconsole.log(array1.fill(6));\n\/\/ expected output: [6, 6, 6, 6]<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>map\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066for\u6587\u306a\u3069\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3092\u4f7f\u308f\u305a\u3068\u3082\u3059\u3079\u3066\u306e\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b push\u30e1\u30bd\u30c3\u30c9 \u914d\u5217\u306e\u6700\u5f8c\u306b\u65b0\u3057\u3044\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u30e1\u30bd\u30c3\u30c9 forEach\u30e1\u30bd\u30c3\u30c9 \u914d\u5217\u306e\u4e2d\u306e\u8981\u7d20\u30921\u3064\u305a\u3064\u53d6\u308a\u51fa<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1771","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1771"}],"version-history":[{"count":3,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1771\/revisions"}],"predecessor-version":[{"id":2197,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/1771\/revisions\/2197"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}