{"id":3685,"date":"2016-09-07T10:00:08","date_gmt":"2016-09-07T01:00:08","guid":{"rendered":"http:\/\/sitest.jp\/blog\/?p=3685"},"modified":"2016-09-07T10:47:34","modified_gmt":"2016-09-07T01:47:34","slug":"javascript%e3%81%a7%e5%ae%9f%e8%b7%b5%ef%bc%81%e3%81%aa%e3%82%93%e3%81%a1%e3%82%83%e3%81%a3%e3%81%a6%e9%96%a2%e6%95%b0%e5%9e%8b%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e3%81%a7","status":"publish","type":"post","link":"https:\/\/sitest.jp\/blog\/?p=3685","title":{"rendered":"JavaScript\u3067\u5b9f\u8df5\uff01\u306a\u3093\u3061\u3083\u3063\u3066\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u4e5d\u4e5d\u8868\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30d7\u30ed\u30c0\u30af\u30c8\u958b\u767a\u30c1\u30fc\u30e0\u306e\u660e\u77f3\u3067\u3059\u3002<\/p>\n<p>\u5165\u793e\u3057\u3066\u306f\u3084\u30015\u30f6\u6708\u304c\u7d4c\u3068\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3044\u307e\u307e\u3067\u5473\u308f\u3063\u305f\u3053\u3068\u306e\u306a\u304b\u3063\u305f\u7d4c\u9a13\u3092\u3044\u308d\u3044\u308d\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u4e00\u756a\u5f37\u70c8\u304b\u3064\u56f0\u3063\u305f\u306e\u304c\u300c\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300d\u3067\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u5b8c\u5168\u306a\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5fc3\u8005\u304c\u300c\u3068\u308a\u3042\u3048\u305a\u3067\u304d\u308b\u3088\u3046\u306b\u300d\u306a\u308b\u307e\u3067\u306b\u5927\u4e8b\u3060\u3068\u601d\u3063\u305f\u8003\u3048\u3092\u66f8\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><!--more--><br \/>\n\u5f0a\u793e\u30b0\u30e9\u30c3\u30c9\u30ad\u30e5\u30fc\u30d6\u3067\u306f\u3001\u307b\u307c\u3059\u3079\u3066\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u3067\u3001\u300cLiveScript\u300d\u3092\u4f7f\u3063\u305f\u3001\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>(\u300cLiveScript\u300d\u3068\u3044\u3046\u306e\u306fJavaScript\u3092\u7c21\u5358\u306b\u66f8\u304f\u3053\u3068\u306e\u3067\u304d\u308b\u3001altJS\u306e\u4e00\u7a2e\u3067\u3059\u3002 \u300cCoffeeScript\u300d\u3068\u304b\u300cTypeScript\u300d\u3068\u304b\u304c\u6709\u540d\u3067\u3059\u306d\u3002)<\/p>\n<p>\u3055\u3066\u3001\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306f\u521d\u3081\u3066\u3067\u3057\u305f\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u3001\u4f55\u4e8b\u3082\u7d4c\u9a13\u3060\u3068\u610f\u6c17\u8fbc\u3093\u3067\u521d\u3081\u3066\u307f\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u521d\u5fc3\u8005\u306e\u3054\u591a\u5206\u306b\u6f0f\u308c\u305a\u3001\u3044\u308d\u3093\u306a\u5165\u9580\u30da\u30fc\u30b8\u3092\u898b\u3066\u306f<\/p>\n<p>\u300c\u53c2\u7167\u900f\u904e\u6027\uff1f\u300d<br \/>\n\u300c\u9ad8\u968e\u95a2\u6570\uff1f\u300d<br \/>\n\u300c\u30ab\u30ea\u30fc\u5316\uff1f\u300d<br \/>\n\u300c\u2026\u308f\u304b\u3089\u306a\u3044\u300d<br \/>\n\u300c\u2026\u3082\u3046\u3060\u3081\u3060&#8230;\u300d\u2190 New\uff01<\/p>\n<p>\u3068\u3044\u3046\u5c55\u958b\u3092\u304f\u308a\u3072\u308d\u3052\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u3082\u3001\u30c1\u30fc\u30e0\u306e\u307f\u3093\u306a\u306b\u805e\u3044\u305f\u308a\u3057\u30662\u30f6\u6708\u304f\u3089\u3044\u3068\u308a\u304f\u3093\u3067\u3044\u305f\u3089\u3001\u3042\u308b\u65e5\u7a81\u7136\u6c17\u4ed8\u304f\u3053\u3068\u304c\u3067\u304d\u305f\u3093\u3067\u3059\uff01\u899a\u3048\u308b\u3068\u304d\u306e\u3081\u3093\u3069\u304f\u3055\u3055\u3092\u9065\u304b\u306b\u4e0a\u56de\u308b\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6700\u5927\u306e\u30e1\u30ea\u30c3\u30c8\u306b\u3002<\/p>\n<p>\u305d\u308c\u306f\u4e00\u8a00\u3067\u3044\u3046\u306a\u3089<\/p>\n<p>\u300c\u66f8\u3044\u3066\u6975\u60aa\u3001\u8aad\u3093\u3067\u5730\u7344\u306e\u30eb\u30fc\u30d7\u5730\u7344\u304b\u3089\u306e\u5352\u696d\u300d<\/p>\n<p>\u3067\u3059\uff01<\/p>\n<p>\u306a\u3093\u3068\u3001\u66f8\u3044\u3066\u3044\u308b\u3046\u3061\u306b\u982d\u304c\u6df7\u4e71\u3057\u3001\u4ed6\u4eba\u306e\u3092\u8aad\u3093\u3060\u3089\u305f\u3061\u307e\u3061\u8def\u982d\u306b\u8ff7\u3046\u3067\u304a\u99b4\u67d3\u307f\u300c\u591a\u91cd\u30eb\u30fc\u30d7\u300d\u304b\u3089\u5352\u696d\u3067\u304d\u308b\u3093\u3067\u3059\uff01<\/p>\n<p>\u305d\u308c\u3069\u3053\u308d\u304b\u3001\u300c1\u91cd\u30eb\u30fc\u30d7 = \u305f\u3060\u306e\u30eb\u30fc\u30d7\u300d\u3059\u3089\u66f8\u304b\u305a\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u304d\u308b\u3093\u3067\u3059\u3088\uff01<\/p>\n<p>\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u3088\u304f\u308f\u304b\u3089\u3093\u7528\u8a9e\u2026\u53c2\u7167\u900f\u660e\u6027\u3068\u304b\u3001\u9ad8\u968e\u95a2\u6570\u3068\u304b\u3001\u30ab\u30ea\u30fc\u5316\u3068\u304b\u2026\u305d\u3046\u3044\u3046\u8a00\u8449\u3067\u8868\u3055\u308c\u308b\u307b\u307c\u3059\u3079\u3066\u306e\u8003\u3048\u304c\u3001\u3053\u306e\u305f\u3081\u306b\u3042\u308b\u3068\u8a00\u3063\u3066\u3082\u904e\u8a00\u3067\u306f\u306a\u3044\u6c17\u304c\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u66f8\u3044\u3066\u307f\u3066\u6c17\u3065\u3044\u305f\u306e\u306f\u3001\u5b9f\u8df5\u30ec\u30d9\u30eb\u3067\u3068\u308a\u3042\u3048\u305a\u5927\u4e8b\u306a\u306e\u306f\u300c\u9ad8\u968e\u95a2\u6570\u300d\u3060\u3051\u3067\u3001\u3042\u3068\u306f\u3001\u3088\u308a\u30a4\u30a4\u611f\u3058\u306b\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u306a\u3093\u3060\u306a\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>(\u7d30\u304b\u304f\u3044\u3046\u3068\u30ab\u30ea\u30fc\u5316\u3055\u308c\u305f\u95a2\u6570\u3082\u9ad8\u968e\u95a2\u6570\u306e\u4e00\u7a2e\u306a\u306e\u3067\u3059\u304c\u4eca\u56de\u306f\u53d6\u308a\u6271\u3044\u307e\u305b\u3093)<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\n2\u3064\u306e\u6570\u3092\u639b\u3051\u3042\u308f\u305b\u308b\u3002\u305d\u308c\u3092\u7e70\u308a\u8fd4\u3059\u3002\u672c\u5f53\u306b\u305d\u308c\u3060\u3051?<br \/>\n<\/h3>\n<\/div>\n<p>\u307e\u3042\u3001\u8a00\u3063\u3066\u308b\u3060\u3051\u3067\u306f\u306a\u3093\u3067\u3059\u306e\u3067\u3001\u5b9f\u969b\u306b\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u984c\u6750\u306f\u30d7\u30ed\u30b0\u30e9\u30de\u65b0\u4eba\u7814\u4fee\u3067\u304a\u99b4\u67d3\u307f(?)\u3001\u300c\u304b\u3051\u7b97\u4e5d\u4e5d\u8868\u3092\u3064\u304f\u308b\u300d\u3067\u3059\u3002\u3053\u308c\u30672\u91cd\u30eb\u30fc\u30d7\u3092\u7fd2\u5f97\u3057\u305f\u65b9\u306f\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u5c11\u306a\u304f\u3068\u3082\u79c1\u306f\u305d\u3046\u3067\u3057\u305f\u3002<\/p>\n<p>3\u91cd\u30eb\u30fc\u30d7\u306b\u306a\u3063\u3066\u30824\u91cd\u30eb\u30fc\u30d7\u306b\u306a\u3063\u3066\u3082\u3001\u8003\u3048\u65b9\u306f\u540c\u3058\u3067\u3059\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3053\u308c\u3067\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f7f\u7528\u3059\u308b\u8a00\u8a9e\u306fJavaScript<\/p>\n<p>\u30a4\u30f3\u30d7\u30c3\u30c8\u306f2\u3064\u306e\u914d\u5217<\/p>\n<pre><code class=\"javascript\">var array_a = [1,2,3,4,5,6,7,8,9];\nvar array_b = [1,2,3,4,5,6,7,8,9];\n<\/code><\/pre>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u3082\u3068\u306b\u304b\u3051\u7b97\u4e5d\u4e5d\u8868\u3067\u3042\u308b2\u91cd\u914d\u5217<\/p>\n<pre><code class=\"javascript\">[[1,2,3,4,5,6,7,8,9],\n[2,4,6,8,10,12,14,16,18],\n[3,6,9,12,15,18,21,24,27],\n[4,8,12,16,20,24,28,32,36],\n[5,10,15,20,25,30,35,40,45],\n[6,12,18,24,30,36,42,48,54],\n[7,14,21,28,35,42,49,56,63],\n[8,16,24,32,40,48,56,64,72],\n[9,18,27,36,45,54,63,72,81]]\n<\/code><\/pre>\n<p>\u3092\u51fa\u529b\u3059\u308b\u51e6\u7406\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<br \/>\n\u307e\u305a\u3001\u666e\u901a\u306b\u3001\u3044\u308f\u3086\u308b\u624b\u7d9a\u304d\u578b\u3067\u66f8\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code class=\"javascript\">var array_99 = [];\nfor(var i = 0; i < array_a.length; i++ ){\n    var array_dan =[];\n    for(var j = 0; j < array_b.length; j++) {\n        array_dan.push(array_a[i] * array_b[j]);\n    }\n    array_99.push(array_dan);\n}\nconsole.table(array_99);\n<\/code><\/pre>\n<p>\u51fa\u529b\u306f\u3053\u3061\u3089<br \/>\n<img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2016\/08\/647fe832493677ad1502b56cdc17c0e9.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2016-08-26 17.19.03\" width=\"753\" height=\"344\" class=\"alignnone size-full wp-image-3701\" \/><br \/>\n\u3053\u3093\u306a\u611f\u3058\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\u30ab\u30a6\u30f3\u30bf\u306e\u5024\u3092\u76f4\u63a5\u8a08\u7b97\u305b\u305a\u306b\u3001\u914d\u5217\u306b\u3057\u3066\u3044\u308b\u7406\u7531\u306f\u3001\u5b9f\u969b\u306b\u30eb\u30fc\u30d7\u3092\u7d44\u3080\u5834\u5408\u3001DB\u306a\u308a\u3001\u5165\u529b\u5024\u306a\u308a\u4ed6\u304b\u3089\u6765\u305f\u914d\u5217\u3092\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u5727\u5012\u7684\u306b\u591a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\u4e0a\u306e\u30b3\u30fc\u30c9\u3067\u306f\u305d\u3082\u305d\u3082\u306earray_a\u3068array_b\u306e\u4ed6\u306b4\u3064\u306e\u5909\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u30fb99\u306e\u7d50\u679c\u30921\u6bb5\u305a\u3064\u5165\u308c\u308b\u305f\u3081\u306e\u914d\u5217(array_99)<br \/>\n\u30fb\u25ef\u306e\u6bb5\u3092\u5165\u308c\u308b\u305f\u3081\u306e\u914d\u5217(array_dan)<br \/>\n\u30fb\u30ab\u30a6\u30f3\u30bf\uff12\u3064(i,j)<\/p>\n<p>\u305d\u3057\u3066\u914d\u5217\u306e\u4e2d\u306e\u3072\u3068\u3064\u3072\u3068\u3064\u306e\u5024array_a[i]\u3068array_b[j]\u3082\u30ab\u30a6\u30f3\u30bf\u3068\u306f\u5225\u306b\u72b6\u614b\u304c\u5909\u5316\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3053\u308c\u3082\u5909\u6570\u6271\u3044\u3057\u30662\u3064\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002\u5408\u8a086\u500b\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u5165\u529b\u3068\u51fa\u529b\u4ee5\u5916\u306b6\u3064\u306e\u5024\u3092\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u30026\u3064\uff01<br \/>\n1\u00d71 1\u00d72 ...... \u3068\u3044\u3046\u611f\u3058\u3067 2\u3064\u306e\u6570\u3092\u639b\u3051\u5408\u308f\u305b\u308b\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3044\u308b\u3060\u3051\u306a\u3093\u3060\u304b\u3089\u30012\u3064\u3067\u3044\u3044\u306f\u305a\u306a\u306e\u306b\u306a\u305c\u304b6\u3064\uff01<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7c21\u5358\u306b\u3059\u308b\u305f\u3081\u3058\u3083\u306a\u304b\u3063\u305f\u306e\u304b\u2026\u3063\u3066\u306a\u308a\u307e\u3059\u3088\u306d\u2026\u3002<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\n\u9ad8\u968e\u95a2\u6570\u300cmap\u300d\u3060\u3051\u3067\u5207\u308a\u629c\u3051\u308b\uff01\u306a\u3093\u3061\u3083\u3063\u3066\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<br \/>\n<\/h3>\n<\/div>\n<p>\u3067\u306f\u3001\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u4e0a\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u76f4\u3057\u307e\u3059\u3002\u8a00\u8a9e\u306f\u76f8\u5909\u308f\u3089\u305a\u305f\u3060\u306eJavaScript\u3067\u3059\u3002<br \/>\n\u4eca\u51fa\u56de\u3063\u3066\u3044\u308b\u307b\u3068\u3093\u3069\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u52d5\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"javascript\">var array_99 = array_a.map(function(a){return array_b.map(function(b){return a * b;});});\nconsole.table(array_99);\n<\/code><\/pre>\n<p>\u4ee5\u4e0a\u3067\u3059\u3002console\u51fa\u529b\u5165\u308c\u30662\u884c\u3002<\/p>\n<p>\u3042\u3001\u672c\u5f53\u306b\u52d5\u304d\u307e\u3059\u3088\u3001\u51fa\u529b\u306f\u3053\u308c\u3067\u3059\u3002<br \/>\n<img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2016\/08\/7ca0fe8995df0e8c1acc918f9d12e99c.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2016-08-26 17.22.59\" width=\"753\" height=\"258\" class=\"alignnone size-full wp-image-3699\" \/><br \/>\n\u3053\u308c\u306f\u307e\u3068\u3081\u3066<\/p>\n<pre><code class=\"javascript\">console.table(array_a.map( function( a ){ return array_b.map( function( b ){ return a * b; } ); } ) );\n<\/code><\/pre>\n<p>\u3068\u3067\u304d\u308b\u306e\u3067\u3001\u306a\u3093\u30681\u884c\uff01<br \/>\n\u305d\u3057\u3066\u3001for\u304c\u3069\u3053\u306b\u3082\u306a\u3044\uff01\u3042\u306e\u3044\u3084\u306a\u30eb\u30fc\u30d7\u304c\u6d88\u3048\u307e\u3057\u305f\uff01\u30d0\u30f3\u30b6\u30a4\uff01\uff01<\/p>\n<p>\u3055\u3066\u3001\u30b7\u30f3\u30d7\u30eb\u3068\u306f\u3044\u3048\u3001\u308f\u304b\u308a\u3065\u3089\u3044\u306e\u3067for\u306e\u4ee3\u308f\u308a\u306b\u51fa\u3066\u304d\u305f\u8981\u7d20\u3092\u6c17\u306b\u3057\u3066\u8aad\u3093\u3067\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u76ee\u3092\u5f15\u304f\u306e\u306f<\/p>\n<pre><code class=\"javascript\">array_x.map\nfunction( x ){ return... }\n<\/code><\/pre>\n<p>\u306e2\u3064\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u3092array_a\u3068b\u305d\u308c\u305e\u308c\u7e70\u308a\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002\u5143\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3082for \u3092array_a\u3068b\u305d\u308c\u305e\u308c\u7e70\u308a\u8fd4\u3057\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u3053\u306e2\u3064\u3067\u30eb\u30fc\u30d71\u56de\u5206\u3092\u8868\u3057\u3066\u3044\u308b\u3093\u3067\u306f\u306a\u3044\u304b\u2026\u3068\u60f3\u50cf\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3081\u3057\u306b\u4e0a\u306e2\u3064\u3092\u4f7f\u3063\u3066\u30eb\u30fc\u30d71\u56de\u5206\u306e\u51e6\u7406\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code class=\"javascript\">var array_a = [1,2,3,4,5,6,7,8,9];\n<\/code><\/pre>\n<p>\u305d\u308c\u305e\u308c\u306b\u6570\u5b573\u3092\u8db3\u3057\u3066<\/p>\n<pre><code class=\"javascript\">[4, 5, 6, 7, 8, 9, 10, 11, 12]\n<\/code><\/pre>\n<p>\u3068\u3044\u3046\u914d\u5217\u3092\u51fa\u529b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code class=\"javascript\">console.log( array_a.map( function( a ){ return a + 3; } ) );\n<\/code><\/pre>\n<p><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2016\/08\/4de3a2be33a20cc8dd9d7db9753870d5.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2016-08-26 17.27.50\" width=\"493\" height=\"56\" class=\"alignnone size-full wp-image-3698\" \/><\/p>\n<p>\u914d\u5217array_a\u306e\u4e2d\u306b\u305d\u308c\u305e\u308c\u306e\u5024\u306b\u3001\u7121\u4e8b\u306b3\u3092\u52a0\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\uff01<\/p>\n<p>\u51fa\u529b\u306b\u4f7f\u3046console.log\u3092\u6d88\u53bb\u3057\u3066\u3001\u7d14\u7c8b\u306a\u51e6\u7406\u3060\u3051\u3092\u307f\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code class=\"javascript\">array_a.map( function( a ){ return a + 3; } );\n<\/code><\/pre>\n<p>\u3082\u3063\u3068\u308f\u304b\u308a\u3084\u3059\u304farray_a\u306e\u4e2d\u8eab\u3092\u30d9\u30bf\u66f8\u304d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code class=\"javascript\">[1,2,3,4,5,6,7,8,9].map( function( a ){ return a + 3; } );\n<\/code><\/pre>\n<p>\u3055\u3066\u3001\u5bdf\u3057\u306e\u3044\u3044\u65b9\u306f\u304a\u6c17\u3065\u304d\u3067\u3057\u3087\u3046\u304c\u300cmap\u300d\u306fArray\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u95a2\u6570(\u30e1\u30bd\u30c3\u30c9)\u3067\u3059\u3002<\/p>\n<p>\u3079\u3064\u306b\u79c1\u304c\u7528\u610f\u3057\u305f\u300carray_a\u300d\u304c\u7279\u5225\u306a\u306e\u3067\u306f\u306a\u304f\u3001JavaScript\u306e\u914d\u5217\u306a\u3089\u3069\u3093\u306a\u3082\u306e\u3067\u3082map\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u95a2\u6570\u300cmap\u300d\u306e\u5f15\u6570\u306f<\/p>\n<pre><code class=\"javascript\">function( a ){ return a + 3; }\n<\/code><\/pre>\n<p>\u300c\u5f15\u6570a\u3092\u53d6\u308a\u3001a+3\u3092\u623b\u308a\u5024\u3068\u3057\u3066\u8fd4\u3059\u95a2\u6570\u300d\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u95a2\u6570\u300cmap\u300d\u306f\u300c\u5143\u306e\u914d\u5217\u5185\u306e\u5024\u305d\u308c\u305e\u308c\u306b\u3001\u5f15\u6570\u3067\u6e21\u3055\u308c\u305f\u95a2\u6570\u306e\u51e6\u7406\u3092\u9069\u7528\u3057\u305f\u65b0\u3057\u3044\u914d\u5217\u3092\u8fd4\u3059\u300d\u95a2\u6570\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3063\u3066\u3064\u307e\u308a\u30eb\u30fc\u30d7\u3092\u52dd\u624b\u306b\u3084\u3063\u3066\u304f\u308c\u308b\u95a2\u6570\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3088\u306d\uff1f<\/p>\n<p>\u3082\u3046\u4e00\u5ea6\u639b\u3051\u7b97\u4e5d\u4e5d\u3092\u51fa\u3059\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code class=\"javascript\">console.table(array_a.map( function( a ){ return array_b.map( function( b ){ return a * b; } ); } ) );\n<\/code><\/pre>\n<p>\u3044\u308f\u3086\u308b2\u91cd\u30eb\u30fc\u30d7\u306a\u306e\u3067\u3001\u95a2\u6570\u300cmap\u300d\u30922\u56de\u4f7f\u3063\u3066\u307e\u3059\u306d\u3002\u6700\u521d\u306e\u914d\u5217\u306emap\u95a2\u6570\u306e\u4e2d\u3067\u3001\u6b21\u306e\u914d\u5217\u306e\u300cmap\u95a2\u6570\u300d\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\u5909\u6570\u3092\u6570\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30fb\u914d\u5217array_a\u306e\u5024\u306e\u3046\u3061\u3072\u3068\u3064\u304c\u5165\u3063\u3066\u3044\u308b\"a\"<br \/>\n\u30fb\u914d\u5217array_b\u306e\u5024\u306e\u3046\u3061\u3072\u3068\u3064\u304c\u5165\u3063\u3066\u3044\u308b\"b\"<\/p>\n<p>\u306a\u3093\u30682\u3064\u3060\u3051\u3067\u3059\uff012\u3064\u306e\u5024\u3092\u639b\u3051\u3042\u308f\u305b\u3066\u3044\u308b\u306e\u3067\u3001\u5909\u6570\u30822\u3064\uff01<br \/>\n\u300c\u7d50\u679c\u3092\u5165\u308c\u308b\u305f\u3081\u306e\u914d\u5217\u300d\u300c\u30ab\u30a6\u30f3\u30bf\u30fc\u300d\u3068\u3044\u3063\u305f\u3001\u51e6\u7406\u306b\u95a2\u4fc2\u306a\u3044\u5909\u6570\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\uff01<br \/>\n\u3064\u3044\u3067\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u30821\u884c\u3067\u3059\uff01<\/p>\n<p>\u51e6\u7406\u5185\u5bb9\u3092\u95a2\u6570\u306e\u5f62\u3067\u66f8\u304f\u306e\u304c\u82e5\u5e72\u3081\u3093\u3069\u304f\u3055\u3044\u3067\u3059\u304c\u3001\u6c17\u306b\u3059\u308b\u5909\u6570\u304c\u6e1b\u3063\u305f\u3076\u3093\u3001\u304b\u306a\u308a\u697d\u306b\u306a\u3063\u305f\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\u305d\u3093\u306a\u512a\u308c\u3082\u306e\u306e\u300cmap\u300d\u306f\u3001\u300c\u5143\u306e\u914d\u5217\u5185\u306e\u5024\u305d\u308c\u305e\u308c\u306b\u3001\u5f15\u6570\u3067\u6e21\u3055\u308c\u305f\u95a2\u6570\u306e\u51e6\u7406\u3092\u9069\u7528\u3057\u305f\u65b0\u3057\u3044\u914d\u5217\u3092\u8fd4\u3059\u95a2\u6570\u300d\u3067\u3057\u305f\u3088\u306d\uff1f<\/p>\n<p>\u3068\u3001\u3053\u3053\u3067\u7a81\u7136\u3001\u30b5\u30d6\u30bf\u30a4\u30c8\u30eb\u306b\u3042\u3063\u305f\u300c\u9ad8\u968e\u95a2\u6570\u300d\u306e\u8aac\u660e\u3092wikipedia\u3067\u898b\u3066\u307f\u307e\u3057\u3087\u3046<\/p>\n<blockquote><p>\u9ad8\u968e\u95a2\u6570\uff08\u3053\u3046\u304b\u3044\u304b\u3093\u3059\u3046\u3001\u82f1: higher-order function\uff09\u3068\u306f\u3001\u95a2\u6570\uff08\u624b\u7d9a\u304d\uff09\u3092\u5f15\u6570\u306b\u3057\u305f\u308a\u3001\u3042\u308b\u3044\u306f\u95a2\u6570\uff08\u624b\u7d9a\u304d\uff09\u3092\u623b\u308a\u5024\u3068\u3059\u308b\u3088\u3046\u306a\u95a2\u6570\u306e\u3053\u3068\u3067\u3042\u308b\u3002<br \/>\n<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E9%AB%98%E9%9A%8E%E9%96%A2%E6%95%B0\" rel=\"nofollow\" target=\"_blank\">https:\/\/ja.wikipedia.org\/wiki\/%E9%AB%98%E9%9A%8E%E9%96%A2%E6%95%B0<\/a>\n<\/p><\/blockquote>\n<p>\u95a2\u6570\u300cmap\u300d\u306f\u95a2\u6570\u3092\u5f15\u6570\u3068\u3059\u308b\u95a2\u6570=\u9ad8\u968e\u95a2\u6570\u3067\u3057\u305f\uff01\u3053\u306e\u8aac\u660e\u3060\u3051\u3060\u3068\u4f55\u304c\u5b09\u3057\u3044\u306e\u304b\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u3001\u4eca\u306a\u3089\u5b09\u3057\u3055\u304c\u7406\u89e3\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u30fb\u9ad8\u968e\u95a2\u6570\u300cmap\u300d\u306f\u3001\u914d\u5217\u306e\u305d\u308c\u305e\u308c\u306e\u8981\u7d20\u306b\u5bfe\u3057\u3066\u51e6\u7406\u3092\u884c\u3046(\u30eb\u30fc\u30d7)<br \/>\n\u30fb\u51e6\u7406\u306e\u5185\u5bb9\u306f\u95a2\u6570\u306e\u5f62\u3067\u6e21\u3057\u3066\u3042\u3052\u308b<\/p>\n<p>\u3053\u308c\u306b\u3088\u3063\u3066\u751f\u307e\u308c\u308b\u30e1\u30ea\u30c3\u30c8\u306f\u300c\u9762\u5012\u304f\u3055\u3044\u30eb\u30fc\u30d7\u3092\u66f8\u304b\u306a\u304f\u3066\u3044\u3044\u300d\u3067\u3057\u305f\u3002<\/p>\n<p>\u4ee5\u4e0a\u3001\u300cJavaScript\u3067\u5b9f\u8df5\uff01\u306a\u3093\u3061\u3083\u3063\u3066\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u4e5d\u4e5d\u8868\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\uff01\u300d\u3067\u3057\u305f\uff01<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\nJavaScript\u306e\u95a2\u6570\u5b9a\u7fa9\u3068altJS<br \/>\n<\/h3>\n<\/div>\n<p>\u2026\u3067\u304a\u308f\u308a\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001\u4e0a\u8a18map\u95a2\u6570\u3068\u3044\u3046\u304b\u300cJavascript\u3067\u306e\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300d\u306e\u30c7\u30e1\u30ea\u30c3\u30c8\u3092\u6562\u3048\u3066\u3042\u3052\u308b\u306a\u3089\u3070\u3001<br \/>\n\u300c\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u306e\u304c\u3081\u3093\u3069\u304f\u3055\u3044\u3001\u898b\u305f\u76ee\u304c\u306a\u3093\u304b\u3054\u3061\u3083\u3063\u3068\u3059\u308b\u300d\u3067\u3059\u306d\u3002<\/p>\n<pre><code class=\"javascript\">function( a ){ return a + 3; }\n<\/code><\/pre>\n<p>\u3068\u304b\u3001\u7d50\u69cb\u306a\u6587\u5b57\u6570\u3067\u3059\u3002\u4eca\u56de\u53d6\u308a\u4e0a\u3052\u305f<\/p>\n<pre><code class=\"javascript\">console.table(array_a.map( function( a ){ return array_b.map( function( b ){ return a * b; } ); } ) );\n<\/code><\/pre>\n<p>\u3082\u3084\u3063\u3071\u308a\u306a\u3093\u304b\u9577\u3044\u3002<\/p>\n<p>\u3068\u3053\u308d\u304c\uff01\u4e16\u306e\u4e2d\u306b\u306faltJS\u3068\u3044\u3046\u4fbf\u5229\u306a\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001JavaScript\u3092\u7c21\u5358\u306b\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u4ed5\u7d44\u307f\u306e\u300c\u30b8\u30e3\u30f3\u30eb\u540d\u300d\u3067\u3059\u3002<br \/>\naltJS\u3067\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u304c\u3001JavaScript\u306e\u30b3\u30fc\u30c9\u306b\u5909\u63db\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\n\u4e16\u306e\u4e2d\u306b\u306f\u3044\u308d\u3044\u308d\u306aaltJS\u304c\u3042\u3063\u3066\u3001\u305d\u306e\u306a\u304b\u306e\u3072\u3068\u3064\u3067\u3042\u308b\u300cCoffeeScript\u300d\u3092\u4f7f\u3048\u3070\u3055\u3063\u304d\u306e\u30b3\u30fc\u30c9\u306f\u3001<br \/>\n\u3082\u3068\u306e\u914d\u5217\u306e\u6e96\u5099\u3082\u542b\u3081\u3066<\/p>\n<pre><code class=\"javascript\">array_a = [1..9]\narray_b = [1..9]\nconsole.table(array_a.map((a)-> array_b.map((b)-> a * b)))\n<\/code><\/pre>\n<p>\u3068\u66f8\u3051\u307e\u3059\u3057\u3001\u5f0a\u793e\u3067\u63a1\u7528\u3057\u3066\u3044\u308b\u3001\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5411\u304d\u306e\u9ad8\u968e\u95a2\u6570\u304c\u5927\u91cf\u306b\u7528\u610f\u3055\u308c\u305f\u300cLiveScript\u300d\u3067\u306f<\/p>\n<pre><code class=\"javascript\">array_a = [1 to 9]\narray_b = [1 to 9]\nconsole.table array_a |> map -> array_b |> map (*it)\n<\/code><\/pre>\n<p>\u3068\u66f8\u3051\u307e\u3059\u3002\u3053\u308c\u5168\u90e8<\/p>\n<pre><code class=\"javascript\">var array_a = [1,2,3,4,5,6,7,8,9];\nvar array_b = [1,2,3,4,5,6,7,8,9];\nvar array_99 = [];\nfor(var i = 0; i < array_a.length; i++ ){\n    var array_dan =[];\n    for(var j = 0; j < array_b.length; j++) {\n        array_dan.push(array_a[i] * array_b[j]);\n    }\n    array_99.push(array_dan);\n}\nconsole.table(array_99);\n<\/code><\/pre>\n<p>\u3068\u540c\u3058\u7d50\u679c\u3067\u3059\u304b\u3089\u306d\uff01<\/p>\n<p>altJS\u306b\u3064\u3044\u3066\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u3067\u306f\u8aac\u660e\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u662f\u975e\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<p>CoffeeScript<br \/>\n<a href=\"http:\/\/coffeescript.org\/\" rel=\"nofollow\" target=\"_blank\">http:\/\/coffeescript.org\/<\/a><br \/>\nLiveScript<br \/>\n<a href=\"http:\/\/livescript.net\/\" rel=\"nofollow\" target=\"_blank\">http:\/\/livescript.net\/<\/a><\/p>\n<p>\u305d\u308c\u3067\u306f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30d7\u30ed\u30c0\u30af\u30c8\u958b\u767a\u30c1\u30fc\u30e0\u306e\u660e\u77f3\u3067\u3059\u3002 \u5165\u793e\u3057\u3066\u306f\u3084\u30015\u30f6\u6708\u304c\u7d4c\u3068\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002 \u3044\u307e\u307e\u3067\u5473\u308f\u3063\u305f\u3053\u3068\u306e\u306a\u304b\u3063\u305f\u7d4c\u9a13\u3092\u3044\u308d\u3044\u308d\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u4e00\u756a\u5f37\u70c8\u304b\u3064\u56f0\u3063\u305f\u306e\u304c\u300c\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300d\u3067\u3057\u305f\u3002 \u4eca\u56de\u306f\u3001\u5b8c\u5168\u306a\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5fc3\u8005\u304c\u300c\u3068\u308a\u3042\u3048\u305a\u3067\u304d\u308b\u3088\u3046\u306b\u300d\u306a\u308b\u307e\u3067\u306b\u5927\u4e8b\u3060\u3068\u601d\u3063\u305f\u8003\u3048\u3092\u66f8\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":3706,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27,38],"tags":[39],"acf":false,"_links":{"self":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/3685"}],"collection":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/comments?post=3685"}],"version-history":[{"count":19,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/3685\/revisions"}],"predecessor-version":[{"id":4052,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/3685\/revisions\/4052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media\/3706"}],"wp:attachment":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media?parent=3685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/categories?post=3685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/tags?post=3685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}