{"id":5411,"date":"2018-07-05T23:14:47","date_gmt":"2018-07-05T14:14:47","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=5411"},"modified":"2023-05-27T21:02:58","modified_gmt":"2023-05-27T12:02:58","slug":"%e3%80%90javascript%e3%80%91%e3%80%8cglobal%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=5411","title":{"rendered":"\u3010JavaScript\u3011\u300cGlobal\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>Global\u30aa\u30d6\u30b8\u30a7\u30af\u30c8(\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8)\u3068\u306f\uff1f<\/h2>\n<p>\u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u300d\u3084\u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u95a2\u6570\u300d\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u3001<span style=\"color: #ff0000;\"><strong>JavaScript\u30a8\u30f3\u30b8\u30f3\u304c\u81ea\u52d5\u751f\u6210\u3059\u308b\u4fbf\u5b9c\u7684\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h2>Global\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7279\u5fb4<\/h2>\n<ul>\n<li>\u901a\u5e38\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u540c\u69d8\u306b\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/li>\n<li>Global\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30f3\u30d0\u3092\u547c\u3073\u51fa\u305b\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<\/ul>\n<h2>Global\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e<\/h2>\n<p>\u7d20\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5bfe\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u3084Node.js\u304c\u5225\u9014\u8ffd\u52a0\u3067\u30d7\u30ed\u30d1\u30c6\u30a3\u3084\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u308a\u3057\u3066\u3044\u307e\u3059\u3002alert\u30e1\u30bd\u30c3\u30c9\u306a\u3093\u304b\u306f\u30d6\u30e9\u30a6\u30b6\u306b\u3057\u304b\u306a\u304fNode.js\u306b\u306f\u306a\u3044\u3067\u3059\u304b\u3089\u306d\u3002<\/p>\n<h3>\u30b3\u30a2\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08ECMAScript\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u4ed5\u69d8\uff09<\/h3>\n<ul>\n<li>parseInt\u30e1\u30bd\u30c3\u30c9<\/li>\n<\/ul>\n<p>\u8a73\u3057\u304f\u306f\u3001MDN\u306e\u300c\u7d44\u307f\u8fbc\u307f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30d3\u30eb\u30c9\u30a4\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u300d\u306e\u30da\u30fc\u30b8\u306b\u8a18\u8f09\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>https:\/\/developer.mozilla.org\/ja\/docs\/Web\/JavaScript\/Reference\/Global_Objects<\/p>\n<h3>\u30d6\u30e9\u30a6\u30b6\u304c\u4ed8\u3051\u8db3\u3057\u305f\u3082\u306e<\/h3>\n<ul>\n<li>alert\u30e1\u30bd\u30c3\u30c9<\/li>\n<li>console\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/li>\n<\/ul>\n<h4>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\uff08API\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\uff09<\/h4>\n<p>https:\/\/developer.mozilla.org\/ja\/docs\/Web\/API<\/p>\n<p>alert\u30e1\u30bd\u30c3\u30c9\u3067\u3042\u308c\u3070Window\u3068\u3044\u3046API\u306e\u4e2d\u306b\u8a18\u8f09\u304c\u3042\u308b\u3002console\u3067\u3042\u308c\u3070Console API\u3092\u898b\u308c\u3070\u4ed5\u69d8\u304c\u8f09\u3063\u3066\u3044\u308b\u3002<\/p>\n<h3>Node.js\u304c\u4ed8\u3051\u8db3\u3057\u305f\u3082\u306e<\/h3>\n<p>MDN\u3067\u306f\u306a\u304fNode.js\u306e\u516c\u5f0f\u30da\u30fc\u30b8\u306eGlobals\u3068\u3044\u3046\u30da\u30fc\u30b8\u306b\u8a18\u8f09\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>https:\/\/nodejs.org\/dist\/latest-v18.x\/docs\/api\/globals.html#global-objects<\/p>\n<h2>\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u8eab\u3092\u898b\u308b\u306b\u306f\uff1f<\/h2>\n<p>\u4ee5\u4e0b\u306e\u5909\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002\u3053\u308c\u3082\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">globalThis<\/pre>\n<p>\u30b0\u30ed\u30fc\u30d0\u30eb\u3067\u3069\u3053\u3067\u3082\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u4e00\u89a7\u3067\u51fa\u3066\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30d6\u30e9\u30a6\u30b6\u3067\u306f<\/h3>\n<p>\u4ee5\u4e0b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3060\u3051\u3067\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">window\r\nself\r\nframes<\/pre>\n<h3>Node.js\u3067\u306f<\/h3>\n<pre class=\"lang:default decode:true \">global<\/pre>\n<h2>\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u304b\uff1f<\/h2>\n<p>\u7d50\u8ad6\u304b\u3089\u8a00\u3048\u3070\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">globalThis.orange = \"\u30aa\u30ec\u30f3\u30b8\";\u3082<\/pre>\n<h3>var\u3092\u4f7f\u3046<\/h3>\n<p>\u5909\u6570\u5ba3\u8a00\u306bvar\u3092\u4f7f\u3046\u3068\u81ea\u52d5\u7684\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002(let\u3084const\u306a\u3069\u306f\u8ffd\u52a0\u3055\u308c\u306a\u3044\u3067\u3059\u3002\uff09<\/p>\n<pre class=\"lang:default decode:true\">var orange = \"\u30aa\u30ec\u30f3\u30b8\";<\/pre>\n<p>\u305f\u3060\u3057\u3001<span style=\"color: #ff0000;\"><strong>\u95a2\u6570\u306e\u4e2d\u3067\u5b9a\u7fa9\u3057\u305f\u5834\u5408\u306f\u8ffd\u52a0\u3055\u308c\u306a\u3044<\/strong><\/span>\u306e\u3067\u6ce8\u610f\u3067\u3059\u3002<\/p>\n<h3>\u95a2\u6570\u5ba3\u8a00<\/h3>\n<p>\u4ee5\u4e0b\u306e\u95a2\u6570\u5ba3\u8a00\u3092\u3057\u305f\u5834\u5408\u3067\u3082\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u81ea\u52d5\u3067\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">function orange () {\r\n return \"\u30aa\u30ec\u30f3\u30b8\";\r\n}<\/pre>\n<h2>\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3084\u3001\u95a2\u6570\u306e\u7279\u5fb4<\/h2>\n<p>\u7279\u5b9a\u306e\u95a2\u6570\u914d\u4e0b\u306b\u5c5e\u3055\u306a\u3044<span style=\"color: #ff0000;\"><strong>\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306e\u5909\u6570\u3084\u95a2\u6570\u306e\u3053\u3068<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u5358\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001\u5ba3\u8a00\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">\u5909\u6570\u540d\r\n\u95a2\u6570\u540d\uff08\u5f15\u6570,\u2026\uff09;<\/pre>\n","protected":false},"excerpt":{"rendered":"Global\u30aa\u30d6\u30b8\u30a7\u30af\u30c8(\u30b0\u30ed\u30fc\u30d0\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8)\u3068\u306f\uff1f \u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u300d\u3084\u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u95a2\u6570\u300d\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u3001JavaScript\u30a8\u30f3\u30b8\u30f3\u304c\u81ea\u52d5\u751f\u6210\u3059\u308b\u4fbf\u5b9c\u7684\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 Global\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7279\u5fb4 \u901a\u5e38 [&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\/5411"}],"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=5411"}],"version-history":[{"count":19,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5411\/revisions"}],"predecessor-version":[{"id":20306,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/5411\/revisions\/20306"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5411"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}