{"id":4283,"date":"2018-06-17T18:44:34","date_gmt":"2018-06-17T09:44:34","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=4283"},"modified":"2023-05-27T21:04:26","modified_gmt":"2023-05-27T12:04:26","slug":"%e3%80%90javascript%e3%80%91%e3%80%8c%e9%96%a2%e6%95%b0%e3%80%8d%e3%81%ae%e4%bb%95%e7%b5%84%e3%81%bf","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=4283","title":{"rendered":"\u3010JavaScript\u3011\u300c\u95a2\u6570\u300d\u306e\u7279\u5fb4\uff08\u300c\u9ad8\u968e\u95a2\u6570\u300d\u3082\u542b\u3081\u3066\uff09"},"content":{"rendered":"<h2>JavaScript\u306e\u95a2\u6570\u306e\u7279\u5fb4<\/h2>\n<ul>\n<li>\u5f15\u6570\u306f\u53ef\u5909\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u3044\u304f\u3089\u3067\u3082\u5f15\u6570\u3092\u6e21\u305b\u307e\u3059\u3002<\/li>\n<li>\u547c\u3073\u51fa\u3055\u308c\u305f\u95a2\u6570\u5074\u3067\u306f\u3001\u300carguments\u300d\u3068\u3044\u3046\u5909\u6570\u3092\u4f7f\u3063\u3066\u3001\u5f15\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u4e0a\u8a18\u306e\u7279\u5fb4\u304b\u3089\u898b\u3066\u5206\u304b\u308b\u3068\u304a\u308a\u3001JavaScript\u306f\u95a2\u6570\u306b\u304a\u3044\u3066\u3082<span style=\"color: #ff0000;\"><strong>\u5236\u7d04\u304c\u975e\u5e38\u306b\u7de9\u3044<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h2>\u95a2\u6570\u306e\u5f15\u6570\u306e\u7279\u5fb4<\/h2>\n<p>JavaScript\u3067\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u95a2\u6570\u5074\u3067\u7528\u610f\u3057\u3066\u3044\u308b\u6570\u3068\u3001\u95a2\u6570\u306b\u4e0e\u3048\u308b\u5f15\u6570\u306e\u6570\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u305b\u3093\u3002<\/strong><\/span><\/p>\n<h3>\u95a2\u6570\u306b\u5f15\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u306e\u306b\u3001\u5f15\u6570\u3092\u4e0e\u3048\u306a\u304b\u3063\u305f\u5834\u5408<\/h3>\n<p>\u95a2\u6570\u5185\u3067\u306e\u5f15\u6570\u306e\u5024\u306f<span style=\"color: #ff0000;\"><strong>\u300cundefined(\u672a\u5b9a\u7fa9\uff09\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u95a2\u6570\u306b\u5f15\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u6570\u4ee5\u4e0a\u306e\u5f15\u6570\u3092\u4e0e\u3048\u305f\u5834\u5408<\/h3>\n<p>\u306f\u307f\u51fa\u3057\u305f\u5f15\u6570\u306e\u5024\u306f<span style=\"color: #ff0000;\"><strong>\u5207\u308a\u6368\u3066\u3089\u308c\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h2>arguments\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066<\/h2>\n<h3>arguments\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u306f\uff1f<\/h3>\n<p>\u95a2\u6570\u914d\u4e0b\u306e\u307f\u5229\u7528\u3067\u304d\u308b\u7279\u5225\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u751f\u6210\u3055\u308c\u3066\u3001\u547c\u3073\u51fa\u3057\u5143\u304b\u3089\u4e0e\u3048\u3089\u308c\u305f\u5f15\u6570\u306e\u6570\u3092\u4fdd\u6301<\/strong><\/span>\u3057\u307e\u3059\u3002<\/p>\n<h3>arguments\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7528\u9014<\/h3>\n<h4>\u5f15\u6570\u306e\u6570\u306e\u30c1\u30a7\u30c3\u30af\u304c\u3067\u304d\u308b\u3002<\/h4>\n<p>\u3053\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u3048\u3070JavaScript\u3067\u306f\u3001\u672c\u6765\u30c1\u30a7\u30c3\u30af\u3067\u304d\u306a\u304b\u3063\u305f\u5f15\u6570\u306e\u6570\u306e\u30c1\u30a7\u30c3\u30af\u3082\u30e6\u30fc\u30b6\u30fc\u306b\u3066\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h4>\u300c\u53ef\u5909\u9577\u5f15\u6570\u306e\u95a2\u6570\u300d\u3068\u3044\u3046\u6a5f\u80fd\u304c\u3042\u308b\u3002<\/h4>\n<p>\u300c\u53ef\u5909\u9577\u5f15\u6570\u306e\u95a2\u6570\u300d\u3068\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u5f15\u6570\u306e\u500b\u6570\u304c\u3042\u3089\u304b\u3058\u3081\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\u95a2\u6570\u306e\u3053\u3068\u300d<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u5f15\u6570\u306e\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u3067\u3001\u67d4\u8edf\u306b\u30bd\u30fc\u30b9\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u5f15\u6570\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/h2>\n<p>ECMAScript2015\u3067\u306f\u3001\u5f15\u6570\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u5f93\u6765\u307e\u3067\u306e\u30b3\u30fc\u30c9\u3068\u6bd4\u3079\u308b\u3068\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:default decode:true\">function \u95a2\u6570\u540d(\u5f15\u6570=\u30c7\u30d5\u30a9\u30eb\u30c8\u5024){\r\n \u2026\r\n}<\/pre>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304c\u9069\u7528\u3055\u308c\u308b\u306e\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u5f15\u6570\u304c\u6e21\u3055\u308c\u306a\u304b\u3063\u305f\u5834\u5408\u306e\u307f<\/strong><\/span>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u9ad8\u968e\u95a2\u6570\u3068\u306f\uff1f<\/h2>\n<p>\u95a2\u6570\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u5909\u6570\u306e\u3088\u3046\u306b\u6271\u3048\u308b\u4ed5\u7d44\u307f\u3092\u5229\u7528\u3057\u3066\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u95a2\u6570\u3092\u5f15\u6570\u3001\u623b\u308a\u5024\u3068\u3057\u3066\u6271\u3063\u305f\u308a\u3001\u5909\u6570\u306b\u4ee3\u5165\u3057\u305f\u308a\u3059\u308b\u95a2\u6570\u306e\u3053\u3068\u300d<\/strong><\/span>\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001forEach\u30e1\u30bd\u30c3\u30c9\u306f\u9ad8\u968e\u95a2\u6570\u3067\u3059\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb<\/h3>\n<pre class=\"lang:default decode:true \">function helloWorld(){\r\n\talert(\"helloWorld\");\r\n}\r\n\r\nfunction hofTest1(){\r\n\tvar h = helloWorld;\r\n\th();\r\n}<\/pre>\n<p>\u4e0a\u8a18\u95a2\u6570\u3067\u306f\u3001\u5225\u306e\u95a2\u6570\u3092\u5909\u6570\u306b\u4ee3\u5165\u3057\u3066\u3001\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30e1\u30ea\u30c3\u30c8<\/h3>\n<ul>\n<li>\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059\u95a2\u6570\u3082\u8272\u3005\u3068\u5909\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u547c\u3073\u51fa\u3057\u5148\u306e\u51e6\u7406\u3092\u53ef\u5909\u7684\u306a\u3082\u306e\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u70b9\u3002<\/li>\n<li>\u666e\u901a\u3001\u95a2\u6570\u306f\u6570\u5024\u3084\u6587\u5b57\u306a\u3069\u3057\u304b\u8a08\u7b97\u5bfe\u8c61\u3068\u306a\u3089\u306a\u3044\u304c\u95a2\u6570\u81ea\u4f53\u306a\u3069\u3082\u8a08\u7b97\u5bfe\u8c61\u3068\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u70b9\u3002<\/li>\n<\/ul>\n<h2>\u9ad8\u968e\u95a2\u6570\u306b\u304a\u3051\u308b\u300c\u5f15\u6570\u3068\u3057\u3066\u4e0e\u3048\u3089\u308c\u308b\u95a2\u6570\u300d\u3067\u3042\u308b\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d\u306b\u3064\u3044\u3066<\/h2>\n<p>\u9ad8\u968e\u95a2\u6570\u306b\u304a\u3044\u3066\u306f\u3001\u5f15\u6570\u3067\u4e0e\u3048\u3089\u308c\u308b\u95a2\u6570\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d<\/strong><\/span>\u3068\u547c\u3070\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"JmrDiXOhsq\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=871\">\u3010JavaScript\u3011\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d\u3084\u3001\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u300d\u306b\u3064\u3044\u3066<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=871&#038;embed=true#?secret=JmrDiXOhsq\" data-secret=\"JmrDiXOhsq\" width=\"500\" height=\"282\" title=\"&#8220;\u3010JavaScript\u3011\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d\u3084\u3001\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u300d\u306b\u3064\u3044\u3066&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306f\u3001\u300c\u305d\u306e\u5834\u9650\u308a\u300d<\/strong><\/span>\u3067\u3057\u304b\u5229\u7528\u3055\u308c\u306a\u3044\u3053\u3068\u306f\u3088\u304f\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3069\u3046\u305b\u4f7f\u3044\u6368\u3066\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u540d\u524d\u4ed8\u304d\u306e\u95a2\u6570\u3088\u308a\u3082\u3001<span style=\"color: #ff0000;\"><strong>\u533f\u540d\u95a2\u6570\uff08\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\uff09<\/strong><\/span>\u3092\u5229\u7528\u3057\u305f\u65b9\u304c\u30b3\u30fc\u30c9\u304c\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308b\u306e\u3067\u3001\u671b\u307e\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u300d\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"BSJ484JrgC\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=5540\">\u3010JavaScript\u3011\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb(\u533f\u540d\u95a2\u6570)\u300d\u3001\u300c\u5373\u6642\u95a2\u6570\u300d\u3068\u306f\uff1f<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=5540&#038;embed=true#?secret=BSJ484JrgC\" data-secret=\"BSJ484JrgC\" width=\"500\" height=\"282\" title=\"&#8220;\u3010JavaScript\u3011\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb(\u533f\u540d\u95a2\u6570)\u300d\u3001\u300c\u5373\u6642\u95a2\u6570\u300d\u3068\u306f\uff1f&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h3>\u4f8b<\/h3>\n<pre class=\"lang:default decode:true\">\/\/\u9ad8\u968e\u95a2\u6570\r\nfunction koukai(func){\r\n  var a = \"test\";\r\n  func(a);\r\n}\r\n\r\n\/\/\u533f\u540d\u95a2\u6570\r\nkoukai(function(a){\r\n  console.log(a);\r\n})<\/pre>\n<h3>\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u3092\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8<\/h3>\n<ul>\n<li>\u30b3\u30fc\u30c9\u304c\u77ed\u304f\u306a\u308b\u3002<\/li>\n<li>\u95a2\u9023\u3059\u308b\u51e6\u7406\u304c\u4e00\u3064\u306e\u6587\u3067\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u547c\u3073\u51fa\u3057\u5143\u306e\u30b3\u30fc\u30c9\u3068\u5b9f\u969b\u306e\u51e6\u7406\u3092\u3057\u3066\u3044\u308b\u95a2\u6570\u3068\u306e\u95a2\u4fc2\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308b\u3002<\/li>\n<li>\u4f7f\u3044\u6368\u3066\u306e\u95a2\u6570\u306b\u5bfe\u3057\u3066\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u4f7f\u308f\u306a\u304f\u3066\u826f\u3044\u306e\u3067\u3001\u540d\u524d\u306e\u91cd\u8907\u306e\u53ef\u80fd\u6027\u3082\u6e1b\u3089\u305b\u308b\u3002<\/li>\n<li>\u4e16\u306e\u4e2d\u306e\u591a\u304f\u306eJavaScript\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u304c\u597d\u3093\u3067\u4f7f\u3063\u3066\u3044\u308b\u624b\u6cd5\u306a\u306e\u3067\u3001\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u89e3\u304f\u969b\u306b\u3082\u6709\u7528\u3067\u3059\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"JavaScript\u306e\u95a2\u6570\u306e\u7279\u5fb4 \u5f15\u6570\u306f\u53ef\u5909\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u3044\u304f\u3089\u3067\u3082\u5f15\u6570\u3092\u6e21\u305b\u307e\u3059\u3002 \u547c\u3073\u51fa\u3055\u308c\u305f\u95a2\u6570\u5074\u3067\u306f\u3001\u300carguments\u300d\u3068\u3044\u3046\u5909\u6570\u3092\u4f7f\u3063\u3066\u3001\u5f15\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002 \u4e0a\u8a18\u306e\u7279\u5fb4\u304b\u3089\u898b\u3066\u5206\u304b\u308b\u3068\u304a\u308a\u3001JavaSc [&hellip;]","protected":false},"author":1,"featured_media":3710,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4283"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4283"}],"version-history":[{"count":18,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4283\/revisions"}],"predecessor-version":[{"id":20310,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/4283\/revisions\/20310"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/3710"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4283"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}