{"id":965,"date":"2024-08-19T14:09:19","date_gmt":"2024-08-19T05:09:19","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/route\/965\/"},"modified":"2025-02-27T10:46:50","modified_gmt":"2025-02-27T01:46:50","slug":"965","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/965\/","title":{"rendered":"JavaScript\u306e\u914d\u5217\u30fbJSON\u30fbmap\u30fbMap\uff1a\u30c7\u30fc\u30bf\u64cd\u4f5c\u8853"},"content":{"rendered":"<div>\n<p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3073\u59cb\u3081\u308b\u3068\u3001<strong>\u914d\u5217<\/strong>\u3084<strong>JSON<\/strong>\u3001\u305d\u3057\u3066<strong>map\u30e1\u30bd\u30c3\u30c9<\/strong>\u3084<strong>Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3068\u3044\u3063\u305f\u8a00\u8449\u3092\u3088\u304f\u76ee\u306b\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u30c7\u30fc\u30bf\u306e\u7ba1\u7406\u3084\u64cd\u4f5c\u306b\u975e\u5e38\u306b\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u304a\u308a\u3001\u7406\u89e3\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u52b9\u7387\u304c\u5927\u304d\u304f\u5411\u4e0a\u3057\u307e\u3059\u3002\u7279\u306bJavaScript\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u4f7f\u3044\u65b9\u3092\u3057\u3063\u304b\u308a\u5b66\u3076\u3053\u3068\u304c\u3001\u3088\u308a\u826f\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306b\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001JavaScript\u306e<strong>\u914d\u5217<\/strong>\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u3001\u305d\u306e\u64cd\u4f5c\u306b\u4fbf\u5229\u306a<strong>map\u30e1\u30bd\u30c3\u30c9<\/strong>\u3001<strong>Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3001\u305d\u3057\u3066<strong>JSON<\/strong>\u306b\u3064\u3044\u3066\u5fb9\u5e95\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u8aad\u3080\u3053\u3068\u3067\u3001\u914d\u5217\u3084JSON\u3001map\u30e1\u30bd\u30c3\u30c9\u3001Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u91cd\u8981\u6027\u3092\u7406\u89e3\u3057\u3001\u305d\u308c\u305e\u308c\u306e\u4f7f\u3044\u65b9\u3092\u3057\u3063\u304b\u308a\u5b66\u3079\u307e\u3059\u3088\u3002<\/p>\n<hr>\n<h3>1. \u914d\u5217\u3068\u306f\uff1f<\/h3>\n<p>JavaScript\u306e\u914d\u5217\u306f\u3001\u8907\u6570\u306e\u30c7\u30fc\u30bf\u3092\u3072\u3068\u3064\u306b\u307e\u3068\u3081\u3066\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u3067\u3059\u3002\u914d\u5217\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u540c\u3058\u7a2e\u985e\u306e\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u53d6\u308a\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u914d\u5217\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u4f4d\u7f6e\u756a\u53f7\uff09\u3092\u4f7f\u3063\u3066\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u8907\u6570\u306e\u8981\u7d20\u3092\u9806\u756a\u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u914d\u5217\u306e\u4f5c\u6210\u65b9\u6cd5<\/p>\n<p>\u914d\u5217\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001[]\uff08\u30d6\u30e9\u30b1\u30c3\u30c8\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u679c\u7269\u306e\u540d\u524d\u3092\u914d\u5217\u3068\u3057\u3066\u683c\u7d0d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code><span>let<\/span> fruits = [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u30d0\u30ca\u30ca\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>];<\/code><\/pre>\n<p>\u3053\u306efruits\u3068\u3044\u3046\u914d\u5217\u306b\u306f\u30013\u3064\u306e\u679c\u7269\uff08\u308a\u3093\u3054\u3001\u30d0\u30ca\u30ca\u3001\u30aa\u30ec\u30f3\u30b8\uff09\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u914d\u5217\u306e\u8981\u7d20\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff080\u304b\u3089\u59cb\u307e\u308b\u756a\u53f7\uff09\u3092\u4f7f\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<br \/>\u4f8b\u3048\u3070\u3001fruits[0]\u306f\u300c\u308a\u3093\u3054\u300d\u3001fruits[1]\u306f\u300c\u30d0\u30ca\u30ca\u300d\u3001fruits[2]\u306f\u300c\u30aa\u30ec\u30f3\u30b8\u300d\u3068\u3044\u3063\u305f\u5177\u5408\u3067\u3059\u3002<\/p>\n<p>\u914d\u5217\u306e\u5909\u66f4<\/p>\n<p>\u914d\u5217\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<br \/>\u4f8b\u3048\u3070\u3001fruits[1]\u306e\u8981\u7d20\u3092\u300c\u3076\u3069\u3046\u300d\u306b\u5909\u66f4\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3051\u307e\u3059\u3002<\/p>\n<pre><code>fruits[<span>1<\/span>] = <span>\"\u3076\u3069\u3046\"<\/span>;\r\nconsole.log(fruits); <span>\/\/<\/span> [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u3076\u3069\u3046\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>]<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u914d\u5217\u306e\u4e2d\u8eab\u306f\u5f8c\u304b\u3089\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u975e\u5e38\u306b\u67d4\u8edf\u3067\u3059\u3002<\/p>\n<hr>\n<h3>2. \u914d\u5217\u306e\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>JavaScript\u306b\u306f\u3001\u914d\u5217\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u7279\u306b\u5f79\u7acb\u3064\u57fa\u672c\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>1. push() &#8211; \u914d\u5217\u306e\u672b\u5c3e\u306b\u8981\u7d20\u3092\u8ffd\u52a0<\/p>\n<p>push()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u914d\u5217\u306e\u6700\u5f8c\u306b\u65b0\u3057\u3044\u8981\u7d20\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u679c\u7269\u306e\u914d\u5217\u306b\u300c\u307f\u304b\u3093\u300d\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408\u3001\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<pre><code>fruits.push(<span>\"\u307f\u304b\u3093\"<\/span>);\r\nconsole.log(fruits); <span>\/\/<\/span> [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u3076\u3069\u3046\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>, <span>\"\u307f\u304b\u3093\"<\/span>]<\/code><\/pre>\n<p>2. pop() &#8211; \u914d\u5217\u306e\u672b\u5c3e\u306e\u8981\u7d20\u3092\u524a\u9664<\/p>\n<p>pop()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u914d\u5217\u306e\u6700\u5f8c\u306e\u8981\u7d20\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u6700\u5f8c\u306e\u300c\u307f\u304b\u3093\u300d\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>fruits.pop();\r\nconsole.log(fruits); <span>\/\/<\/span> [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u3076\u3069\u3046\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>]<\/code><\/pre>\n<p>3. shift() &#8211; \u914d\u5217\u306e\u5148\u982d\u306e\u8981\u7d20\u3092\u524a\u9664<\/p>\n<p>shift()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u914d\u5217\u306e\u6700\u521d\u306e\u8981\u7d20\u3092\u524a\u9664\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u4f8b\u3067\u306f\u3001\u300c\u308a\u3093\u3054\u300d\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>fruits.shift();\r\nconsole.log(fruits); <span>\/\/<\/span> [<span>\"\u3076\u3069\u3046\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>]<\/code><\/pre>\n<p>4. unshift() &#8211; \u914d\u5217\u306e\u5148\u982d\u306b\u8981\u7d20\u3092\u8ffd\u52a0<\/p>\n<p>unshift()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u914d\u5217\u306e\u6700\u521d\u306b\u65b0\u3057\u3044\u8981\u7d20\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u300c\u3044\u3061\u3054\u300d\u3092\u914d\u5217\u306e\u5148\u982d\u306b\u8ffd\u52a0\u3059\u308b\u5834\u5408\u3001\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<pre><code>fruits.unshift(<span>\"\u3044\u3061\u3054\"<\/span>);\r\nconsole.log(fruits); <span>\/\/<\/span> [<span>\"\u3044\u3061\u3054\"<\/span>, <span>\"\u3076\u3069\u3046\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>]<\/code><\/pre>\n<p>5. join() &#8211; \u914d\u5217\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u7d50\u5408<\/p>\n<p>\u914d\u5217\u306e\u8981\u7d20\u30921\u3064\u306e\u6587\u5b57\u5217\u3068\u3057\u3066\u7d50\u5408\u3059\u308b\u5834\u5408\u3001join()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002\u533a\u5207\u308a\u6587\u5b57\u3092\u6307\u5b9a\u3057\u3066\u7d50\u5408\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code><span>console<\/span>.log(fruits.join(<span>\", \"<\/span>)); <span>\/\/ \"\u3044\u3061\u3054, \u3076\u3069\u3046, \u30aa\u30ec\u30f3\u30b8\"<\/span><\/code><\/pre>\n<h3>3. JSON\u3068\u306f\uff1f<\/h3>\n<p><strong>JSON\uff08JavaScript Object Notation\uff09\u306f\u3001\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u4ea4\u63db\u3059\u308b\u305f\u3081\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002JSON\u306f\u4e3b\u306b\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u30b5\u30fc\u30d0\u30fc\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u9593\u3067\u30c7\u30fc\u30bf\u3092\u3084\u308a\u53d6\u308a\u3059\u308b\u969b\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002JSON\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u914d\u5217<\/strong>\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u8868\u73fe\u3057\u307e\u3059\u3002<\/p>\n<p>JSON\u306e\u57fa\u672c\u69cb\u9020<\/p>\n<p>JSON\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u4e2d\u62ec\u5f27{}\u3067\u56f2\u307e\u308c\u3001\u30ad\u30fc\u3068\u30d0\u30ea\u30e5\u30fc\u306e\u30da\u30a2\u3067\u69cb\u6210\u3055\u308c\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306a\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u8868\u3059JSON\u30c7\u30fc\u30bf\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code>{\r\n  <span>\"name\"<\/span>: <span>\"\u7530\u4e2d\u592a\u90ce\"<\/span>,\r\n  <span>\"age\"<\/span>: <span>25<\/span>,\r\n  <span>\"isStudent\"<\/span>: <span>true<\/span>\r\n}<\/code><\/pre>\n<p>\u307e\u305f\u3001JSON\u306e\u914d\u5217\u306f\u89d2\u62ec\u5f27[]\u3067\u56f2\u307e\u308c\u3001\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u5024\u3092\u307e\u3068\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u8907\u6570\u306e\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u542b\u3080JSON\u914d\u5217\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>[<span>\r\n  { <span>\"name\"<\/span>: <span>\"\u7530\u4e2d\u592a\u90ce\"<\/span>, <span>\"age\"<\/span>: 25 },\r\n  { <span>\"name\"<\/span>: <span>\"\u4f50\u85e4\u82b1\u5b50\"<\/span>, <span>\"age\"<\/span>: 28 },\r\n  { <span>\"name\"<\/span>: <span>\"\u9234\u6728\u4e00\u90ce\"<\/span>, <span>\"age\"<\/span>: 22 }\r\n<\/span>]<\/code><\/pre>\n<p>JSON\u3068\u914d\u5217\u306e\u9055\u3044<\/p>\n<p><strong>JSON<\/strong>\u3068<strong>\u914d\u5217<\/strong>\u306f\u3001\u3069\u3061\u3089\u3082\u30c7\u30fc\u30bf\u3092\u307e\u3068\u3081\u308b\u65b9\u6cd5\u3067\u3059\u304c\u3001\u4f7f\u3046\u5834\u9762\u3084\u76ee\u7684\u304c\u7570\u306a\u308a\u307e\u3059\u3002\u8eab\u8fd1\u306a\u3082\u306e\u306b\u4f8b\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>\u914d\u5217\u306f\u300c\u5f15\u304d\u51fa\u3057\u300d<\/strong><\/p>\n<p>\u914d\u5217\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067\u4f7f\u3046\u30c7\u30fc\u30bf\u306e\u300c<strong>\u5f15\u304d\u51fa\u3057<\/strong>\u300d\u3060\u3068\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u5f15\u304d\u51fa\u3057\u306b\u306f\u3044\u308d\u3093\u306a\u7a2e\u985e\u306e\u3082\u306e\uff08\u30c7\u30fc\u30bf\uff09\u3092\u5165\u308c\u3089\u308c\u307e\u3059\u304c\u3001\u3059\u3079\u3066\u3092\u4e00\u3064\u306e\u5f15\u304d\u51fa\u3057\u306b\u307e\u3068\u3081\u3066\u304a\u3051\u308b\u306e\u3067\u3001\u5fc5\u8981\u306a\u6642\u306b\u3059\u3050\u53d6\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u3042\u306a\u305f\u304c\u300c\u597d\u304d\u306a\u679c\u7269\u300d\u3092\u30e1\u30e2\u3057\u305f\u3044\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u3001\u914d\u5217\u3092\u4f7f\u3046\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<pre><code><span>let<\/span> fruits = [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u30d0\u30ca\u30ca\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>];<\/code><\/pre>\n<p>\u3053\u3053\u3067\u3001fruits\u3068\u3044\u3046\u306e\u306f\u300c\u679c\u7269\u300d\u3068\u3044\u3046\u540d\u524d\u306e\u5f15\u304d\u51fa\u3057\u3067\u3001\u4e2d\u306b\u306f\u300c\u308a\u3093\u3054\u300d\u300c\u30d0\u30ca\u30ca\u300d\u300c\u30aa\u30ec\u30f3\u30b8\u300d\u3068\u3044\u3046\u30c7\u30fc\u30bf\uff08\u679c\u7269\u306e\u540d\u524d\uff09\u304c\u9806\u756a\u306b\u5165\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5f15\u304d\u51fa\u3057\u306e\u4e2d\u8eab\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u4f8b\u3048\u3070\u300c\u30d0\u30ca\u30ca\u300d\u3092\u53d6\u308a\u51fa\u3057\u305f\u308a\u3001\u5225\u306e\u679c\u7269\u3092\u8ffd\u52a0\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u5f15\u304d\u51fa\u3057\uff08\u914d\u5217\uff09\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u3067\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u3044\u3066\u3044\u308b\u9593\u306b\u3069\u3093\u3069\u3093\u5909\u5316\u3057\u307e\u3059\u3002\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3092\u305d\u306e\u90fd\u5ea6\u53d6\u308a\u51fa\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<hr>\n<p><strong>JSON\u306f\u300c\u8377\u7269\u3092\u9001\u308b\u305f\u3081\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u300d<\/p>\n<p>\u4e00\u65b9\u3067\u3001<strong>JSON<\/strong>\u306f\u300c\u30c7\u30fc\u30bf\u3092\u4ed6\u306e\u5834\u6240\u3084\u30b7\u30b9\u30c6\u30e0\u306b\u9001\u308b\u305f\u3081\u306e\u300c\u30d1\u30c3\u30b1\u30fc\u30b8\u300d\u300d\u3060\u3068\u601d\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u4f8b\u3048\u3070\u3001\u3042\u306a\u305f\u304c\u5f15\u304d\u51fa\u3057\uff08\u914d\u5217\uff09\u306e\u4e2d\u8eab\u3092\u8ab0\u304b\u306b\u6e21\u3059\u305f\u3081\u306b\u3001\u3057\u3063\u304b\u308a\u30e9\u30d9\u30eb\u3092\u3064\u3051\u3066\u3001\u7bb1\u306b\u8a70\u3081\u3066\u9001\u308a\u305f\u3044\u3068\u304d\u3001\u3053\u308c\u304cJSON\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u5148\u307b\u3069\u306e\u679c\u7269\u306e\u30ea\u30b9\u30c8\u3092\u5225\u306e\u4eba\u306b\u6e21\u3059\u3068\u304d\u3001\u76f4\u63a5\u5f15\u304d\u51fa\u3057\u3092\u6e21\u3059\u306e\u3067\u306f\u306a\u304f\u3001<strong>\u30c7\u30fc\u30bf\u3092\u7bb1\u306b\u8a70\u3081\u3066\u3001\u30e9\u30d9\u30eb\u3092\u4ed8\u3051\u305f\u72b6\u614b<\/strong>\u3067\u9001\u308b\u308f\u3051\u3067\u3059\u3002\u3053\u306e\u30e9\u30d9\u30eb\u4ed8\u304d\u306e\u7bb1\u304cJSON\u3067\u3059\u3002<\/p>\n<pre><code>{\r\n  <span>\"fruits\"<\/span>: [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u30d0\u30ca\u30ca\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>]\r\n}<\/code><\/pre>\n<p>\u3053\u3053\u3067\u3001fruits\u3068\u3044\u3046\u30e9\u30d9\u30eb\u304c\u4ed8\u3044\u305f\u7bb1\u306b\u300c\u308a\u3093\u3054\u300d\u300c\u30d0\u30ca\u30ca\u300d\u300c\u30aa\u30ec\u30f3\u30b8\u300d\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u7bb1\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067\u306f\u306a\u304f\u3001<strong>\u5225\u306e\u30b7\u30b9\u30c6\u30e0\u3084\u30b5\u30fc\u30d0\u30fc\u3068\u306e\u9593\u3067\u30c7\u30fc\u30bf\u3092\u3084\u308a\u53d6\u308a\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059<\/strong>\u3002<\/p>\n<p>JSON\u306f\u6587\u5b57\u901a\u308a\u300c\u7bb1\u300d\u3084\u300c\u30d1\u30c3\u30b1\u30fc\u30b8\u300d\u306e\u3088\u3046\u306b\u3001<strong>\u30c7\u30fc\u30bf\u3092\u4ed6\u306e\u5834\u6240\u306b\u9001\u308b\u305f\u3081\u306b<\/strong>\u4f7f\u3046\u306e\u3067\u3001\u305d\u306e\u4e2d\u8eab\u3092\u9001\u308a\u624b\u3068\u53d7\u3051\u624b\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u5f62\u5f0f\u3067\u5305\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001JSON\u306f\u30c7\u30fc\u30bf\u4ea4\u63db\u7528\u306e\u300c\u68b1\u5305\u6750\u300d\u3068\u8003\u3048\u3066\u3082\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h3>4. JavaScript\u3068JSON\u306e\u76f8\u4e92\u5909\u63db<\/h3>\n<p>JavaScript\u3067\u306f\u3001JSON\u3068JavaScript\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u914d\u5217\u3092\u7c21\u5358\u306b\u76f8\u4e92\u5909\u63db\u3067\u304d\u307e\u3059\u3002JSON.stringify()\u3092\u4f7f\u3046\u3068\u3001JavaScript\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u914d\u5217\u3092JSON\u5f62\u5f0f\u306e\u6587\u5b57\u5217\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002\u4e00\u65b9\u3001JSON.parse()\u3092\u4f7f\u3046\u3068\u3001JSON\u5f62\u5f0f\u306e\u6587\u5b57\u5217\u3092JavaScript\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u914d\u5217\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092JSON\u306b\u5909\u63db<\/p>\n<pre><code><span>let<\/span> user = { <span>name<\/span>: <span>\"\u7530\u4e2d\u592a\u90ce\"<\/span>, <span>age<\/span>: <span>25<\/span>, <span>isStudent<\/span>: <span>true<\/span> };\r\n<span>let<\/span> userJSON = <span>JSON<\/span>.stringify(user);\r\n<span>console<\/span>.log(userJSON); <span>\/\/ '{\"name\":\"\u7530\u4e2d\u592a\u90ce\",\"age\":25,\"isStudent\":true}'<\/span><\/code><\/pre>\n<p>JSON\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db<\/p>\n<pre><code><span>let<\/span> jsonString = '{<span>\"name\"<\/span>:<span>\"\u7530\u4e2d\u592a\u90ce\"<\/span>,<span>\"age\"<\/span>:<span>25<\/span>,<span>\"isStudent\"<\/span>:<span>true<\/span>}';\r\n<span>let<\/span> userObj = <span>JSON<\/span>.parse(jsonString);\r\nconsole.log(userObj); <span>\/\/ { name: '\u7530\u4e2d\u592a\u90ce', age: 25, isStudent: true }<\/span><\/code><\/pre>\n<hr>\n<h3>5. map()\u30e1\u30bd\u30c3\u30c9\u3068\u914d\u5217\u306e\u9055\u3044<\/h3>\n<p>\u3053\u3053\u3067\u767b\u5834\u3059\u308b<strong>map()\u30e1\u30bd\u30c3\u30c9<\/strong>\u306f\u3001\u914d\u5217\u306e\u5404\u8981\u7d20\u306b\u5bfe\u3057\u3066\u64cd\u4f5c\u3092\u52a0\u3048\u3066\u3001\u305d\u306e\u7d50\u679c\u3092\u65b0\u3057\u3044\u914d\u5217\u3068\u3057\u3066\u8fd4\u3059\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u914d\u5217\u306f\u305d\u306e\u307e\u307e\u30c7\u30fc\u30bf\u3092\u7ba1\u7406\u3059\u308b\u69cb\u9020\u3067\u3059\u304c\u3001map()\u306f\u305d\u306e\u914d\u5217\u3092\u5909\u63db\u3057\u3066\u65b0\u3057\u3044\u914d\u5217\u3092\u4f5c\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>map()\u306e\u4f7f\u3044\u65b9<\/p>\n<p>map()\u306f\u3001\u914d\u5217\u306e\u5404\u8981\u7d20\u306b\u95a2\u6570\u3092\u9069\u7528\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u65b0\u3057\u3044\u914d\u5217\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002\u5143\u306e\u914d\u5217\u306f\u5909\u66f4\u3055\u308c\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u914d\u5217\u5185\u306e\u6587\u5b57\u5217\u3092\u5927\u6587\u5b57\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u3001map()\u3092\u4f7f\u3063\u3066\u6b21\u306e\u3088\u3046\u306b\u66f8\u3051\u307e\u3059\u3002<\/p>\n<pre><code><span>let<\/span> fruits = [<span>\"\u308a\u3093\u3054\"<\/span>, <span>\"\u30d0\u30ca\u30ca\"<\/span>, <span>\"\u30aa\u30ec\u30f3\u30b8\"<\/span>];\r\n<span>let<\/span> uppercaseFruits = fruits.map(<span><span>function<\/span>(<span>fruit<\/span>) <\/span>{\r\n  <span>return<\/span> fruit.toUpperCase();\r\n});\r\n<span>console<\/span>.log(uppercaseFruits); <span>\/\/ [\"\u308a\u3093\u3054\", \"\u30d0\u30ca\u30ca\", \"\u30aa\u30ec\u30f3\u30b8\"]\u304c\u5927\u6587\u5b57\u306b\u5909\u63db\u3055\u308c\u305f\u65b0\u3057\u3044\u914d\u5217\u304c\u51fa\u529b\u3055\u308c\u308b\u3002<\/span><\/code><\/pre>\n<p>\u914d\u5217\u3068map()\u306e\u9055\u3044<\/p>\n<ul>\n<li>\n<p><strong>\u914d\u5217<\/strong>\u306f\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u300c\u7bb1\u300d\u3067\u3042\u308a\u3001\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u308a\u3001\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p>map()\u306f\u914d\u5217\u306b\u5bfe\u3057\u3066\u5909\u63db\u3092\u884c\u3044\u3001\u305d\u306e\u7d50\u679c\u3092\u65b0\u3057\u3044\u914d\u5217\u3068\u3057\u3066\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u5143\u306e\u914d\u5217\u81ea\u4f53\u306f\u5909\u308f\u308a\u307e\u305b\u3093\u3002<\/p>\n<\/li>\n<\/ul>\n<p>map()\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u914d\u5217\u306e\u5404\u8981\u7d20\u306b\u5bfe\u3057\u3066\u4e00\u62ec\u3067\u5909\u63db\u3092\u884c\u3063\u305f\u308a\u3001\u51e6\u7406\u3092\u52a0\u3048\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<hr>\n<h3>6. Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u306f\uff1f<\/h3>\n<p>\u3053\u3053\u3067\u7d39\u4ecb\u3059\u308b\u306e\u306f\u3001<strong>Map\u578b\u30c7\u30fc\u30bf\u69cb\u9020<\/strong>\uff08Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3067\u3059\u3002\u3053\u308c\u306f\u3001JavaScript\u3067\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u3067\u3001\u914d\u5217\u3068\u306f\u7570\u306a\u308a\u3001\u9806\u756a\u3092\u6c17\u306b\u305b\u305a\u306b\u3001<strong>\u4efb\u610f\u306e\u578b\u306e\u30ad\u30fc\u3068\u5024<\/strong>\u3092\u5bfe\u5fdc\u3055\u305b\u3066\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f7f\u3044\u65b9<\/p>\n<p>Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u3046\u3068\u3001<strong>\u30ad\u30fc\u3068\u30d0\u30ea\u30e5\u30fc\u306e\u30da\u30a2<\/strong>\u3092\u683c\u7d0d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30ad\u30fc\u306b\u306f\u6587\u5b57\u5217\u3060\u3051\u3067\u306a\u304f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u95a2\u6570\u3082\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre><code>let userMap = new Map();\r\nuserMap.set(<span>\"name\"<\/span>, <span>\"\u7530\u4e2d\u592a\u90ce\"<\/span>);\r\nuserMap.set(<span>\"age\"<\/span>, <span>25<\/span>);\r\nuserMap.set(<span>\"isStudent\"<\/span>, <span>true<\/span>);\r\n\r\nconsole.log(userMap); <span>\/\/<\/span> Map(<span>3<\/span>) { <span>\"name\"<\/span> =&gt; <span>\"\u7530\u4e2d\u592a\u90ce\"<\/span>, <span>\"age\"<\/span> =&gt; <span>25<\/span>, <span>\"isStudent\"<\/span> =&gt; <span>true<\/span> }<\/code><\/pre>\n<p>set()\u30e1\u30bd\u30c3\u30c9\u3067\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3001get()\u30e1\u30bd\u30c3\u30c9\u3067\u5024\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code><span>console<\/span>.log(userMap.get(<span>\"name\"<\/span>)); <span>\/\/ \"\u7530\u4e2d\u592a\u90ce\"<\/span><\/code><\/pre>\n<p>Map\u306e\u5229\u70b9<\/p>\n<ul>\n<li>\n<p><strong>\u9806\u756a\u3092\u4fdd\u6301<\/strong>\uff1a\u914d\u5217\u3068\u9055\u3063\u3066\u3001Map\u306f\u633f\u5165\u3057\u305f\u9806\u756a\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4efb\u610f\u306e\u30ad\u30fc<\/strong>\uff1aMap\u306f\u3001\u6587\u5b57\u5217\u4ee5\u5916\u306e\u30c7\u30fc\u30bf\u578b\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u95a2\u6570\u306a\u3069\uff09\u3092\u30ad\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u52b9\u7387\u7684\u306a\u64cd\u4f5c<\/strong>\uff1aMap\u306f\u3001get()\u3084set()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u8981\u7d20\u306e\u8ffd\u52a0\u3084\u53d6\u5f97\u304c\u975e\u5e38\u306b\u9ad8\u901f\u3067\u3059\u3002<\/p>\n<\/li>\n<\/ul>\n<hr>\n<h3>7. \u307e\u3068\u3081<\/h3>\n<p>JavaScript\u306e\u914d\u5217\u3001JSON\u3001map()\u30e1\u30bd\u30c3\u30c9\u3001\u305d\u3057\u3066Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u305d\u308c\u305e\u308c\u7570\u306a\u308b\u76ee\u7684\u3067\u30c7\u30fc\u30bf\u3092\u7ba1\u7406\u30fb\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u975e\u5e38\u306b\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002\u914d\u5217\u306f\u8907\u6570\u306e\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306b\u3001map()\u30e1\u30bd\u30c3\u30c9\u306f\u305d\u306e\u30c7\u30fc\u30bf\u3092\u5909\u63db\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002JSON\u306f\u30c7\u30fc\u30bf\u4ea4\u63db\u306b\u4fbf\u5229\u3067\u3001Map\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u3067\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u7ba1\u7406\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u3092\u3046\u307e\u304f\u4f7f\u3044\u3053\u306a\u3059\u3053\u3068\u3067\u3001\u3088\u308a\u52b9\u7387\u7684\u3067\u67d4\u8edf\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n","protected":false},"featured_media":966,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/965"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/966"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}