{"id":14600,"date":"2019-07-29T09:00:04","date_gmt":"2019-07-29T00:00:04","guid":{"rendered":"https:\/\/www.agent-grow.com\/self20percent\/?p=14600"},"modified":"2019-07-31T08:18:04","modified_gmt":"2019-07-30T23:18:04","slug":"what-is-javascript-new","status":"publish","type":"post","link":"https:\/\/www.agent-grow.com\/self20percent\/2019\/07\/29\/what-is-javascript-new\/","title":{"rendered":"\u3055\u3059\u304c\u306b\u305d\u308d\u305d\u308d JavaScript \u306e new (\u3042\u3068\u7d99\u627f\u3082)\u306b\u3064\u3044\u3066\u7406\u89e3\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u308b\u3042\u306a\u305f\u306b\u3002"},"content":{"rendered":"<h1>class \u304c\u306a\u3044\u306e\u306b new \u3059\u308b\u3063\u3066\u3069\u3044\u3046\u3044\u3046\u3053\u3068\uff1f<\/h1>\n<p>JavaScript \u66f8\u3044\u3066\u307e\u3059\u304b\uff1f<\/p>\n<p>JavaScript \u3092\u66f8\u3044\u3066\u3044\u308b\u3042\u306a\u305f\u306f\u3054\u5b58\u3058\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001<br \/>\n\u3042\u306e\u8a00\u8a9e\u306b\u306f class \u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3044\u3084\u3001\u6b63\u78ba\u306b\u306f ES6 (\u6700\u8fd1\u306e\u66f8\u304d\u65b9) \u306b\u306f class \u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u304c\u3001\u3053\u3061\u3089\u3092\u8aad\u3093\u3067\u3044\u305f\u3060\u3044\u305f\u3089\u5206\u304b\u308b\u3088\u3046\u306b\u3001<\/p>\n<p>https:\/\/developer.mozilla.org\/ja\/docs\/Web\/JavaScript\/Reference\/Classes<\/p>\n<p>Java \u306b\u3042\u308b\u3088\u3046\u306a\u3001 class \u3068\u3044\u3046\u8003\u3048\u65b9\u304c\u8ffd\u52a0\u3055\u308c\u305f\u308f\u3051\u3067\u306f\u306a\u3044\u3067\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001 JavaScript \u306e new \u306f\u3001class \u304b\u3089\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u3064\u304f\u308b\u3084\u3064\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>\u2026\u3068\u8a00\u3046\u611f\u3058\u306e\u8a71\u3092\u805e\u304b\u3055\u308c\u3066\u3001\u7279\u306b Java \u306b\u89aa\u3057\u3093\u3067\u3053\u3089\u308c\u305f\u65b9\u306f<br \/>\n\u300cnew \u3063\u3066 class \u304b\u3089\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u308b\u3084\u3064\u3061\u3083\u3046\u3093\u304b\uff01\uff1f class \u306a\u3044\u306e\u306b new \u304c\u3042\u308b\u3068\u304b\u3069\u3046\u3044\u3046\u3053\u3068\u3084\uff01\u300d<br \/>\n\u3063\u3066\u3001\u3053\u308c\u307e\u3067\u306a\u3063\u3066\u305f\u8a33\u3067\u3059\u3002<\/p>\n<p>\u5206\u304b\u308a\u307e\u3059\u3088\u3002\u305d\u306e\u6c17\u6301\u3061\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u305d\u3093\u306a\u6c17\u6301\u3061\u304c\u89e3\u6d88\u3067\u304d\u308b\u3088\u3046\u306b\u3001<br \/>\nJavaScript \u306e new \u306b\u3064\u3044\u3066\u898b\u3066\u3044\u3053\u3046\u3058\u3083\u3042\u308a\u307e\u305b\u3093\u304b\u3002<\/p>\n<h1>Java \u306e new \u306b\u3064\u3044\u3066<\/h1>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001JavaScript \u306e new \u306b\u3064\u3044\u3066\u304a\u8a71\u3057\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001<br \/>\n\u305d\u306e\u524d\u306b\u3001\u5272\u3068\u306a\u3058\u307f\u304c\u6df1\u3044\u3068\u601d\u308f\u308c\u308b\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u306e\u8a00\u8a9e\u306b\u304a\u3051\u308b new \u304b\u3089\u8003\u3048\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u306e\u8a00\u8a9e\u3067\u3001\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u8a00\u8a9e\u306e\u4e00\u3064\u304c Java \u3067\u3059\u306d\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimport java.util.*;\n\nclass Hoge {\n\n    private String fuga;\n\n    public Hoge(String fuga) {\n        this.fuga = fuga;\n    }\n\n    public String getFuga() {\n        return this.fuga;\n    }\n}\n\npublic class Main {\n    public static void main(String&#x5B;] args) throws Exception {\n\n        Hoge hoge1 = new Hoge(\u201d\u3075\u304c\u3075\u304c\u201d);\n\n        \/\/ \u3075\u304c\u3075\u304c\u3068\u51fa\u529b\u3055\u308c\u308b\n        System.out.println(hoge1.getFuga());\n    }\n}\n<\/pre>\n<p>\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u30b7\u30f3\u30d7\u30eb\u306b\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u305f\u3089\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u304b\u306d\uff1f<br \/>\nnew \u3092\u3064\u304b\u3063\u3066\u3044\u308b\u306e\u306f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nHoge hoge1 = new Hoge(\u201d\u3075\u304c\u3075\u304c\u201d);\n<\/pre>\n<p>\u3053\u306e\u90e8\u5206\u3002<\/p>\n<p>\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u306f\u3001class \u306f\u3072\u306a\u5f62\u3067\u3042\u308a\u3001<br \/>\nnew \u3092\u4f7f\u3063\u3066\u305d\u306e\u5b9f\u4f53\u3092\u3064\u304f\u308b\u3002<\/p>\n<p>\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u540c\u3058\u6a5f\u80fd\u3092\u6301\u3064\uff08\u4eca\u56de\u306e\u5834\u5408\u306f fuga \u3068\u3044\u3046\u5909\u6570\u3092\u6301\u3061\u3001\u305d\u308c\u3092\u51fa\u529b\u3059\u308b\u6a5f\u80fd\uff09\u5b58\u5728\u3092\u8907\u6570\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3042\u305f\u308a\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3084\u308b\u4e0a\u3067\u3088\u304f\u898b\u308b\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u306e\u8003\u3048\u65b9\u3067\u3059\u306d\u3002<\/p>\n<h1>JavaScript \u306e new<\/h1>\n<p>\u5148\u307b\u3069\u3068\u540c\u3058\u4e8b\u3092 JavaScript \u3067\u3084\u308d\u3046\u3068\u3059\u308b\u3068\u3001\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar Hoge = function (fuga) {\n  this.fuga = fuga;\n};\n\nHoge.prototype.getFuga = function() {\n  return this.fuga;\n};\n\nvar hoge = new Hoge(\u2019\u3075\u304c\u3075\u304c\u2019);\n\n\/\/ \u3075\u304c\u3075\u304c\u3068\u51fa\u529b\u3055\u308c\u308b\nconsole.log(hoge.getFuga());\n<\/pre>\n<p>\u30b5\u30f3\u30d7\u30eb\u306a\u3093\u304b\u3067\u3088\u304f\u898b\u308b\u5f62\u306b\u306a\u308a\u307e\u3057\u305f\u306d\u3002<\/p>\n<p>\u3053\u3053\u3067\u5927\u5207\u306a\u306e\u306f\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar hoge = new Hoge(\u2019\u3075\u304c\u3075\u304c\u2019);\n<\/pre>\n<p>\u3053\u306e\u90e8\u5206\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u5f85\u3063\u3066\uff01<br \/>\n\u78ba\u304b Hoge \u306f\u6700\u521d\u306b\u300cfunction\u300d\u3092\u5b9a\u7fa9\u3057\u305f\u5909\u6570\u3067\u306f\uff1f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar Hoge = function (fuga) {\n  this.fuga = fuga;\n};\n<\/pre>\n<p>\u305d\u3046\u306a\u3093\u3067\u3059\u3002<br \/>\nJavaScript \u3067\u306f class \u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3001function \u306b\u5bfe\u3057\u3066 new \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u306e\u51e6\u7406\u306e\u6d41\u308c\u3092\u5177\u4f53\u7684\u306b\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001\u6c17\u3092\u3064\u3051\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u306f\u3001 <code>new Hoge(\u2019\u3075\u304c\u3075\u304c\u2019)<\/code> \u306f<br \/>\n<code>new \u6f14\u7b97\u5b50<\/code> \u306e\u8a08\u7b97\u3068\u3001 <code>Hoge(\u2019\u3075\u304c\u3075\u304c\u2019)<\/code> \u306e\u95a2\u6570\u5b9f\u884c\u306b\u5206\u3051\u3089\u308c\u308b\u70b9\u3067\u3059\u3002<br \/>\n\u4f8b\u3048\u3070 <code>3 + 5 * 2<\/code> \u3068\u3044\u3046\u5f0f\u304c\u3042\u308c\u3070 <code>5 * 2 = 10<\/code> \u3092\u5148\u306b\u3057\u3066 <code>10 + 3 = 13<\/code> \u3068\u306a\u308b\u3088\u3046\u306b\u3001<br \/>\n\u8a08\u7b97\u306f\u5fc5\u305a\u9806\u5e8f\u3092\u8003\u3048\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>https:\/\/developer.mozilla.org\/ja\/docs\/Web\/JavaScript\/Reference\/Operators\/Operator_Precedence#Table<\/p>\n<p>\u3053\u306e\u30da\u30fc\u30b8\u3092\u53c2\u7167\u3057\u3066\u307f\u308b\u3068\u3001<\/p>\n<ul>\n<li>new (\u5f15\u6570\u3092\u4f34\u3046): \u512a\u5148\u9806\u4f4d 19<\/li>\n<li>\u95a2\u6570\u547c\u3073\u51fa\u3057: \u512a\u5148\u9806\u4f4d 18<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001 new \u306e\u65b9\u304c\u512a\u5148\u9806\u4f4d\u304c\u9ad8\u3044\u3067\u3059\u306d\uff01<\/p>\n<p>\u3064\u307e\u308a\u3001\u3053\u306e\u51e6\u7406\u3067\u306f\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u306f\u7f6e\u3044\u3066\u304a\u3044\u3066\u3001 <code>new Hoge<\/code> \u3092\u5b9f\u884c\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u306f <code>new Hoge<\/code> \u306f\u4f55\u3092\u3057\u3066\u3044\u308b\u306e\u304b\uff1f<\/p>\n<p>\u3053\u3053\u306f Java \u3068\u307b\u307c\u540c\u3058\u3067\u3059\u3002<br \/>\n\u3059\u306a\u308f\u3061\u3001 Hoge \u95a2\u6570\u3092\u3072\u306a\u5f62\u3068\u3057\u3066\u3001\u5b9f\u4f53\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>Hoge \u306e\u5b9f\u4f53\u3068\u3044\u3046\u3068\u96e3\u3057\u3044\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u4ee5\u4e0b\u3068 <code>\u307b\u307c<\/code> \u540c\u3058\u3067\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{}\n<\/pre>\n<p>\u4f55\uff1f\u3068\u601d\u308f\u308c\u307e\u3057\u305f\u304b\uff1f\u305d\u3046\u3067\u3059\u3002\u7a7a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u306d\u3002<br \/>\n\uff08\u307b\u307c\u3001\u3068\u3044\u3046\u306e\u306f\u3001\u5b9f\u969b\u306b\u306f\u7a7a\u3067\u306f\u306a\u3044\u304b\u3089\u3067\u3059\u3002\u305d\u306e\u7406\u7531\u306f\u5f8c\u307b\u3069\u3002\uff09<\/p>\n<p>\u7a7a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308c\u3070\u3072\u306a\u5f62\u3082\u7121\u3044\u306e\u3067\u306f\uff1f\u666e\u901a\u306b\u7a7a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3064\u304f\u308c\u3070\u826f\u3044\u3058\u3083\u3093\u3002\u3068\u601d\u308f\u308c\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001<br \/>\n\u3053\u3053\u304b\u3089\u304c new \u306e\u80fd\u529b\u3092\u767a\u63ee\u3059\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<h1>new \u306e\u80fd\u529b 1: \u6307\u5b9a\u3055\u308c\u305f\u95a2\u6570\u3067\u521d\u671f\u5316\u3059\u308b<\/h1>\n<p>new \u306f\u95a2\u6570 Hoge \u3092\u5bfe\u8c61\u3068\u3057\u3066\u3068\u3063\u3066\u3044\u307e\u3057\u305f\u306d\uff1f<br \/>\n\u30a2\u30ec\u306b\u306f\u610f\u5473\u304c\u3042\u308a\u307e\u3057\u3066\u3001new \u306f\u751f\u6210\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u3067\u3001\u6307\u5b9a\u3055\u308c\u305f\u95a2\u6570\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u78ba\u304b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar Hoge = function (fuga) {\n  this.fuga = fuga;\n};\n<\/pre>\n<p>\u3053\u3046\u3067\u3057\u305f\u306d\u3002<\/p>\n<p>\u4eca\u6ce8\u76ee\u3059\u308b\u306e\u306f\u3001\u3053\u306e <code>this<\/code> \u306e\u90e8\u5206\u3002<br \/>\n\u5148\u307b\u3069\u751f\u6210\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u3067\u3053\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u306e\u3067\u3001<br \/>\n\u3053\u306e this \u306f\u5148\u307b\u3069\u306e\u7a7a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u3057\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u306f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ \u7a7a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3066\nvar test = {};\n\n\/\/ \u305d\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3057\u3066 fuga \u3092\u8a2d\u5b9a\ntest.fuga = fuga;\n<\/pre>\n<p>\u3053\u308c\u3068\u4e00\u7dd2\u3067\u3059\u3002<br \/>\n\u306a\u305c\u3063\u3066\u3001 this = \u5148\u307b\u3069\u306e\u7a7a\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u304b\u3089\u306d\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4e00\u9023\u306e\u6d41\u308c\u3092\u6574\u7406\u3059\u308b\u3068 <code>new Hoge(\u2019\u3075\u304c\u3075\u304c\u2019)<\/code> \u304c\u751f\u6210\u3057\u305f\u3082\u306e\u306f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar test = {};\ntest.fuga = \u2019\u3075\u304c\u3075\u304c\u2019\n<\/pre>\n<p>\u3053\u3046\u306a\u306e\u3067\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  fuga: \u2019\u3075\u304c\u3075\u304c\u2019\n}\n<\/pre>\n<p>\u3053\u3093\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u3067\u304d\u305f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>new \u306e\u80fd\u529b 2: \u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u3092\u7d99\u627f\u3059\u308b<\/h1>\n<p>\u3055\u3066\u3001new \u304c\u4f55\u3092\u4f5c\u3063\u305f\u306e\u304b\u306f\u5206\u304b\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3067\u3082\u307e\u3060\u4e00\u3064\u89e3\u6c7a\u3057\u3066\u3044\u306a\u3044\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3088\u306d\uff1f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/\/ \u3075\u304c\u3075\u304c\u3068\u51fa\u529b\u3055\u308c\u308b\nconsole.log(hoge.getFuga());\n<\/pre>\n<p>\u3053\u308c\u3067 \u3075\u304c\u3075\u304c \u3068\u8868\u793a\u3055\u308c\u308b\u3068\u8a00\u3046\u3053\u3068\u304c\u307e\u3060\u8aac\u660e\u3067\u304d\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u4f5c\u3089\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u672c\u5f53\u306b fuga \u3057\u304b\u6301\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3042\u308c\u3070\u3001 <code>getFuga<\/code> \u306a\u3093\u3066\u95a2\u6570\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3042\u306e\u30b3\u30fc\u30c9\u304c\u6b63\u3057\u304f\u52d5\u304f\u305f\u3081\u306b\u306f\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  fuga: \u2019\u3075\u304c\u3075\u304c\u2019,\n  getFuga: function() { return this.fuga; }\n}\n<\/pre>\n<p>\u3053\u3093\u306a\u304b\u3093\u3058\u3067\u3001getFuga \u95a2\u6570\u304c\u540c\u3058\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5185\u306b\u3044\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3088\u306d\uff1f<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar Hoge = function (fuga) {\n  this.fuga = fuga;\n};\n\nHoge.prototype.getFuga = function() {\n  return this.fuga;\n};\n\nvar hoge = new Hoge(\u2019\u3075\u304c\u3075\u304c\u2019);\n\nconsole.log(hoge);\n<\/pre>\n<p>\u305f\u3081\u3057\u306b\u3001\u6700\u5f8c\u306e log \u51fa\u529b\u3067 hoge \u306e\u4e2d\u8eab\u305d\u306e\u3082\u306e\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\nGoogle Chrome \u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u52d5\u4f5c\u3092\u898b\u3066\u307f\u308b\u3068\u2026<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"14604\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/07\/29\/what-is-javascript-new\/%e7%84%a1%e9%a1%8c-77\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" data-orig-size=\"282,264\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" alt=\"\" width=\"282\" height=\"264\" class=\"alignnone size-full wp-image-14604\" \/><\/p>\n<p>Hoge \u306e\u4e2d\u8eab\u306b\u6ce8\u76ee\u3059\u308b\u3068\u3001\u4e00\u898b fuga \u30d7\u30ed\u30d1\u30c6\u30a3\u3057\u304b\u306a\u3044\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002<br \/>\n\u304c\u3001\u3057\u304b\u3057 <code>__proto__<\/code> \u3068\u3044\u3046\u3088\u304f\u5206\u304b\u3089\u306a\u3044\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u4e2d\u306b\u3001<br \/>\ngetFuga \u95a2\u6570\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u306d\uff01<\/p>\n<p>\u3053\u308c\u304c new \u3057\u305f\u3068\u304d\u306e\u4e8c\u3064\u76ee\u306e\u80fd\u529b\u3067\u3059\uff01<br \/>\n\u6ce8\u76ee\u3057\u305f\u3044\u306e\u306f\u3053\u3053<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nHoge.prototype.getFuga = function() {\n  return this.fuga;\n};\n<\/pre>\n<p>prototype \u3068\u3044\u3046\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u4e0b\u306b\u3001 getFuga \u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u306d\u3002<br \/>\n\u3053\u306e prototype \u3068\u3044\u3046\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u7279\u6b8a\u3067\u3001<br \/>\nnew \u3067\u7a7a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u3064\u304f\u3089\u308c\u305f\u6642\u3001\u3053\u306e\u914d\u4e0b\u306e\u5185\u5bb9\u306f\u65b0\u3057\u304f\u4f5c\u3089\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u7d99\u627f\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u7d99\u627f\u3067\u3059\u304b\u3089\u3001 Java \u3067\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3059\u308b\u3088\u3046\u306b\u3001<br \/>\n\u3042\u305f\u304b\u3082\u81ea\u5206\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5b58\u5728\u3059\u308b\u304b\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u6240\u3001\u4eca\u56de\u306e\u3088\u3046\u306b getFuga() \u3092\u547c\u3073\u51fa\u3057\u305f\u969b\u3001JavaScript \u306e\u5185\u90e8\u3067\u306f<\/p>\n<hr \/>\n<p>\u307e\u305a\u3001\u81ea\u5206\u81ea\u8eab\u306b <code>getFuga<\/code> \u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u3001\u5b58\u5728\u3059\u308c\u3070\u5b9f\u884c\u3057\u3066\u7d42\u4e86<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  fuga: \u2019\u3075\u304c\u3075\u304c\u2019,\n  getFuga: function() { return this.fuga; }\n}\n<\/pre>\n<p>getFuga \u304c\u7121\u3051\u308c\u3070\u3001 <code>__proto__<\/code> \u5185\u306b getFuga \u304c\u306a\u3044\u304b\u78ba\u8a8d\u3001\u5b58\u5728\u3059\u308c\u3070\u5b9f\u884c\u3057\u3066\u7d42\u4e86<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  fuga: \u2019\u3075\u304c\u3075\u304c\u2019,\n  __proto__: {\n    getFuga: function() { return this.fuga; }\n  }\n}\n<\/pre>\n<p>\u3055\u3089\u306b\u7121\u3051\u308c\u3070\u3001 <code>__proto__<\/code> \u5185\u306e <code>__proto__<\/code> \u5185\u306b getFuga \u304c\u306a\u3044\u304b\u78ba\u8a8d\u3001\u5b58\u5728\u3059\u308c\u3070\u5b9f\u884c\u3057\u3066\u7d42\u4e86<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n  fuga: \u2019\u3075\u304c\u3075\u304c\u2019,\n  __proto__: {\n    __proto__: {\n      getFuga: function() { return this.fuga; }\n    }\n  }\n}\n<\/pre>\n<p>&#8230; \u3053\u308c\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3044\u304d\u3001 <strong>proto<\/strong> \u304c\u305f\u3069\u308c\u306a\u3044\u6240\uff08\u4e00\u756a\u5927\u672c\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u307e\u3067\u305f\u3069\u308a\u7740\u3044\u3066\u3082 getFuga \u304c\u898b\u3064\u304b\u3089\u306a\u3051\u308c\u3070\u3001\u672a\u5b9a\u7fa9\u3068\u3057\u3066\u30a8\u30e9\u30fc\u306b\u306a\u308b<\/p>\n<hr \/>\n<p>\u3068\u3044\u3046\u3088\u3046\u306a\u6319\u52d5\u3067\u52d5\u3044\u3066\u3044\u308b\u306e\u3067\u3059\u306d\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u3088\u3046\u306b <code>__proto__<\/code> \u3092\u305f\u3069\u3063\u3066\u3044\u304f\u6319\u52d5\u3092\u3001\u9396\u3092\u3064\u306a\u3052\u3066\u3044\u304f\u69d8\u5b50\u306b\u898b\u7acb\u3066\u3066\u3001\u300c\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u30c1\u30a7\u30fc\u30f3\u300d\u3068\u547c\u3093\u3067\u3044\u307e\u3059\u3002<br \/>\n\u3082\u3057\u304b\u3057\u305f\u3089\u3001\u3053\u306e\u8a00\u8449\u306b\u3064\u3044\u3066\u306f\u3069\u3053\u304b\u3067\u805e\u3044\u305f\u3053\u3068\u304c\u3042\u308b\u65b9\u3082\u3044\u3089\u3063\u3057\u3083\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u306d\u3002<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u306e\u304a\u304b\u3052\u3067\u3001\u6674\u308c\u3066 \u201d\u3075\u304c\u3075\u304c\u201d \u304c\u51fa\u529b\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3059\u306d\u3002<\/p>\n<h1>\u307e\u3068\u3081<\/h1>\n<p>\u3069\u3046\u3067\u3059\u304b\uff1f<br \/>\nJava \u8133\u3067\u8003\u3048\u308b\u3068\u3061\u3087\u3063\u3068\u96e3\u3057\u304f\u611f\u3058\u308b JavaScript \u306e new \u3067\u3059\u304c\u3001<br \/>\n\u3069\u3061\u3089\u306e new \u3082\u3084\u308a\u305f\u3044\u3053\u3068\u306f\u3001\u3072\u306a\u5f62\u304b\u3089\u65b0\u3057\u3044\u5b9f\u614b\u3092\u751f\u6210\u3059\u308b\u3060\u3051\u2026\u3068\u8003\u3048\u3066\u3082\u826f\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u30d9\u30fc\u30b9\u306e\u8003\u3048\u65b9\u306f\u3071\u3063\u3068\u898b\u3067\u306f\u96e3\u3057\u305d\u3046\u3067\u3059\u304c\u3001<br \/>\n\u9806\u306b\u7d10\u89e3\u3044\u3066\u3044\u3051\u3070\u4f55\u3068\u8a00\u3046\u3053\u3068\u306f\u306a\u304f\u3001\u30af\u30e9\u30b9\u30d9\u30fc\u30b9\u306a\u8003\u3048\u65b9\u3068\u3061\u3087\u3053\u3063\u3068\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u7570\u306a\u308b\u3060\u3051\u3001<br \/>\n\u3068\u8a00\u3046\u3053\u3068\u3092\u611f\u3058\u3066\u3082\u3089\u3048\u307e\u3057\u305f\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u7279\u6b8a\u306a\u6319\u52d5\u3082\u591a\u3044 JavaScript \u3067\u3059\u304c\u3001<br \/>\n\u6016\u3058\u6c17\u3065\u304b\u305a\u4e00\u3064\u305a\u3064\u7406\u89e3\u3057\u3066\u3044\u304d\u3001\u3046\u307e\u304f\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u305f\u3044\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>class \u304c\u306a\u3044\u306e\u306b new \u3059\u308b\u3063\u3066\u3069\u3044\u3046\u3044\u3046\u3053\u3068\uff1f JavaScript \u66f8\u3044\u3066\u307e\u3059\u304b\uff1f JavaScript \u3092\u66f8\u3044\u3066\u3044\u308b\u3042\u306a\u305f\u306f\u3054\u5b58\u3058\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001 \u3042\u306e\u8a00\u8a9e\u306b\u306f class \u304c\u3042\u308a\u307e\u305b\u3093\u3002 \u3044\u3084\u3001\u6b63\u78ba\u306b\u306f  [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":14607,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[45],"class_list":["post-14600","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-javascript"],"jetpack_featured_media_url":"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/07\/850c7612116999490846136e772ab7fd-4.png","jetpack_shortlink":"https:\/\/wp.me\/p7Bq4F-3Nu","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts\/14600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/comments?post=14600"}],"version-history":[{"count":0,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts\/14600\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/media\/14607"}],"wp:attachment":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/media?parent=14600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/categories?post=14600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/tags?post=14600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}