{"id":7212,"date":"2015-03-16T20:46:23","date_gmt":"2015-03-16T12:46:23","guid":{"rendered":"http:\/\/jpuyy.com\/?p=7212"},"modified":"2015-03-16T20:46:48","modified_gmt":"2015-03-16T12:46:48","slug":"javascript-object-concept","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=7212","title":{"rendered":"javascript\u4e2d\u7684object"},"content":{"rendered":"<p>\u201cIn C++ or C#, when we\u2019re talking about objects, we\u2019re referring to instances of classes or structs. Objects have different properties and methods, depending on which templates (that is, classes) they are instantiated from. That\u2019s not the case with JavaScript objects. In JavaScript, objects are just collections of name\/value pairs &#8211; think of a JavaScript object as a dictionary with string keys.\u201d<\/p>\n<p>\u6458\u5f55\u6765\u81ea: Manuel Kiessling. \u201cThe Node Beginner Book\u201d<\/p>\n<p>\u81ea\u5df1\u5728 node \u4e2d\u5c1d\u8bd5<\/p>\n<pre>\r\n&gt; var handle = {}\r\nundefined\r\n&gt; handle[\"\/\"] = 'aaa';\r\n'aaa'\r\n&gt; handle[\"\/start\"] = 'aaa\/start';\r\n'aaa\/start'\r\n&gt; handle[\"\/upload\"] = 'aaa\/upload';\r\n'aaa\/upload'\r\n&gt; handle\r\n{ '\/': 'aaa',\r\n'\/start': 'aaa\/start',\r\n'\/upload': 'aaa\/upload' }\r\n&gt; typeof(handle)\r\n'object'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u201cIn C++ or C#, when we\u2019re talking about objects, we\u2019re referring to instances of classes or structs. Objects have different properties and methods, depending on which templates (that is, classes) they are instantiated from. That\u2019s not the case with JavaScript objects. In JavaScript, objects are just collections of name\/value pairs &#8211; think of a JavaScript [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[170],"tags":[],"class_list":["post-7212","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7212"}],"version-history":[{"count":2,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7212\/revisions"}],"predecessor-version":[{"id":7226,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/7212\/revisions\/7226"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}