{"id":5540,"date":"2018-07-07T22:46:37","date_gmt":"2018-07-07T13:46:37","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=5540"},"modified":"2023-05-27T21:01:06","modified_gmt":"2023-05-27T12:01:06","slug":"%e3%80%90javascript%e3%80%91%e3%80%8c%e9%96%a2%e6%95%b0%e3%83%aa%e3%83%86%e3%83%a9%e3%83%ab%e3%80%8d%e3%81%a8%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=5540","title":{"rendered":"\u3010JavaScript\u3011\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb(\u533f\u540d\u95a2\u6570)\u300d\u3001\u300c\u5373\u6642\u95a2\u6570\u300d\u3068\u306f\uff1f"},"content":{"rendered":"<h2>\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u300d\u3068\u306f\uff1f<\/h2>\n<p>\u30a2\u30d7\u30ea\u958b\u767a\u8005\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u95a2\u6570\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n<p>\u95a2\u6570\u81ea\u4f53\u306f\u3001JavaScript\u306b\u304a\u3044\u3066\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u30c7\u30fc\u30bf\u578b\u306e\u4e00\u7a2e<\/strong><\/span>\u3068\u306a\u308a\u3001\u6587\u5b57\u5217\u3084\u6570\u5024\u306e\u3088\u3046\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u30ea\u30c6\u30e9\u30eb<\/strong><\/span>\u3068\u3057\u3066\u5ba3\u8a00\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u306e\u8a18\u6cd5\u306b\u3064\u3044\u3066<\/h2>\n<p>\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u540d\u524d\u306e\u306a\u3044\u95a2\u6570\u3092\u3092\u5b9a\u7fa9<\/strong><\/span>\u3057\u305f\u4e0a\u3067\u3001\u5909\u6570\u306b\u4ee3\u5165\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">var \u5909\u6570\u540d = function(\u5f15\u6570){\r\n};<\/pre>\n<p>\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u306f\u540d\u524d\u304c\u306a\u3044\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u533f\u540d\u95a2\u6570\u3084\u3001\u7121\u540d\u95a2\u6570<\/strong><\/span>\u3068\u547c\u3070\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u300d\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>\u95a2\u6570\u306e\u540d\u524d\u3092\u8003\u3048\u308b\u624b\u9593\u3092\u7701\u3051\u308b\u3002<\/p>\n<p>\u9ad8\u968e\u95a2\u6570\u3092\u4f7f\u3046\u969b\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u4e3b\u306b\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3092\u4e0a\u3052\u308b\u3068\u3044\u3046\u70b9\u3067\u975e\u5e38\u306b\u91cd\u5b9d\u3059\u308b\u8a18\u8ff0\u65b9\u6cd5<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u5408\u308f\u305b\u3066\u3054\u89a7\u4e0b\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"AaePRPQGpU\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=4283\">\u3010JavaScript\u3011\u300c\u95a2\u6570\u300d\u306e\u7279\u5fb4\uff08\u300c\u9ad8\u968e\u95a2\u6570\u300d\u3082\u542b\u3081\u3066\uff09<\/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=4283&#038;embed=true#?secret=AaePRPQGpU\" data-secret=\"AaePRPQGpU\" width=\"500\" height=\"282\" title=\"&#8220;\u3010JavaScript\u3011\u300c\u95a2\u6570\u300d\u306e\u7279\u5fb4\uff08\u300c\u9ad8\u968e\u95a2\u6570\u300d\u3082\u542b\u3081\u3066\uff09&#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>JavaScript\u306e\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u89e3\u304f\u969b\u306b\u3082\u3001\u304b\u306a\u308a\u6709\u7528\u306a\u77e5\u8b58\u306b\u306a\u308b\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u300d<\/strong><\/span>\u306b\u95a2\u3057\u3066\u306f\u3057\u3063\u304b\u308a\u7406\u89e3\u3092\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u5373\u6642\u95a2\u6570\u3068\u306f\uff1f<\/h2>\n<p>\u305d\u306e\u540d\u306e\u901a\u308a<span style=\"color: #ff0000;\"><strong>\u300c\u5373\u6642\u306b\u5b9f\u884c\u3055\u308c\u308b\u95a2\u6570\u300d<\/strong><\/span>\u306e\u3053\u3068\u3002\u533f\u540d\u95a2\u6570\u306e\u4e00\u7a2e\u3067\u3059\u304c\u3001\u533f\u540d\u95a2\u6570\u3068\u9055\u3063\u3066\u5909\u6570\u306b\u95a2\u6570\u3092\u4ee3\u5165\u305b\u305a\u305d\u306e\u307e\u307e\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30e1\u30ea\u30c3\u30c8<\/h3>\n<h4>\u30b9\u30b3\u30fc\u30d7\u306e\u6c5a\u67d3\u3092\u9632\u3050\u305f\u3081\u3002<\/h4>\n<p>JavaScript\u306e\u5909\u6570\u306e\u30b9\u30b3\u30fc\u30d7\u306f\u3001\u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u30b9\u30b3\u30fc\u30d7\u300d\u3068\u300c\u95a2\u6570\u30b9\u30b3\u30fc\u30d7\u300d\u306e\u4e8c\u3064\u3067\u3059\u3002\u95a2\u6570\u306e\u4e2d\u3067\u5909\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u3068\u95a2\u6570\u306e\u5916\u5074\u306e\u5909\u6570\u3092\u4e0d\u7528\u610f\u306b\u4e0a\u66f8\u304d\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5927\u304d\u304f\u306a\u308b\u306b\u3064\u308c\u3066\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u304c\u4e0d\u8981\u306a\u5909\u6570\u3067\u57cb\u3081\u5c3d\u304f\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u69cb\u6587<\/h3>\n<pre class=\"lang:default decode:true\">const result(\u623b\u308a\u5024) = (function(\u5f15\u65701,\u5f15\u65702) {\r\n  ...\r\n}(\u5f15\u65701,\u5f15\u65702));<\/pre>\n<h3>\u6ce8\u610f\u70b9<\/h3>\n<h4>\u3042\u304f\u307e\u3067\u4f7f\u3044\u6368\u3066\u7528\u9014\u3067\u4f7f\u3046\u3053\u3068<\/h4>\n<p>\u518d\u5229\u7528\u304c\u3055\u308c\u306a\u3044\u4f7f\u3044\u6368\u3066\u306e\u51e6\u7406\u306e\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002\u3082\u3057\u3001\u518d\u5229\u7528\u3057\u305f\u3044\u5834\u5408\u306f\u540d\u524d\u4ed8\u304d\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>\u5c11\u3057\u5206\u304b\u308a\u3065\u3089\u3044<\/h4>\n<p>\u6587\u6cd5\u306e\u7279\u6027\u4e0a\u3001\u30ab\u30c3\u30b3\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u306e\u3067\u3082\u3057\u623b\u308a\u5024\u304c\u4e8c\u3064\u307e\u3067\u306e\u95a2\u6570\u3067\u3042\u308c\u3070\u4e09\u9805\u6f14\u7b97\u5b50\u3067\u4ee3\u66ff\u3067\u304d\u306a\u3044\u304b\u306f\u691c\u8a0e\u3057\u3066\u3082\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:default decode:true\">const result(\u623b\u308a\u5024) = (function(\u5f15\u65701) {\r\n  if (\u6761\u4ef61) return xxx;\r\n  return yyy;\r\n}(\u5f15\u6570));<\/pre>\n<p>\u4f8b\u3048\u3070\u4e0a\u8a18\u306e\u3088\u3046\u306a\u30b5\u30f3\u30d7\u30eb\u3067\u3042\u308c\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u3066\u3082\u3063\u3068\u7c21\u6f54\u306b\u66f8\u3051\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">const result(\u623b\u308a\u5024) = \u6761\u4ef61 ? xxx : yyy;<\/pre>\n<p>\u306a\u306e\u3067\u4f7f\u3044\u6240\u3068\u3057\u3066\u306f\u3001\u623b\u308a\u5024\u304c3\u3064\u4ee5\u4e0a\u767a\u751f\u3057\u3066\u3044\u308b\uff08\u3082\u3057\u304f\u306f3\u3064\u4ee5\u4e0a\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u5834\u5408\u306b\u9650\u5b9a\u3059\u308b\u3079\u304d\u3067\u3057\u3087\u3046\u3002\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"\u300c\u95a2\u6570\u30ea\u30c6\u30e9\u30eb\u300d\u3068\u306f\uff1f \u30a2\u30d7\u30ea\u958b\u767a\u8005\u304c\u3001\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u95a2\u6570\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306e\u4e00\u3064\u3067\u3059\u3002 \u95a2\u6570\u81ea\u4f53\u306f\u3001JavaScript\u306b\u304a\u3044\u3066\u306f\u3001\u30c7\u30fc\u30bf\u578b\u306e\u4e00\u7a2e\u3068\u306a\u308a\u3001\u6587\u5b57\u5217\u3084\u6570\u5024\u306e\u3088\u3046\u306b\u3001\u30ea\u30c6\u30e9\u30eb\u3068\u3057\u3066\u5ba3\u8a00\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u95a2\u6570\u30ea [&hellip;]","protected":false},"author":1,"featured_media":0,"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\/5540"}],"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=5540"}],"version-history":[{"count":9,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5540\/revisions"}],"predecessor-version":[{"id":20299,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5540\/revisions\/20299"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5540"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}