 {"id":447,"date":"2012-05-15T10:13:30","date_gmt":"2012-05-15T02:13:30","guid":{"rendered":"http:\/\/www.qyuef.com\/?p=447"},"modified":"2012-05-15T10:13:30","modified_gmt":"2012-05-15T02:13:30","slug":"15%e5%88%86%e9%92%9f%e5%86%85%e6%8e%8c%e6%8f%a1javascript%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1%e7%bc%96%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/www.qyuef.com\/?p=447","title":{"rendered":"15\u5206\u949f\u5185\u638c\u63e1JavaScript\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b"},"content":{"rendered":"<p>\u5230\u5904\u90fd\u662f\u5c5e\u6027\u3001\u65b9\u6cd5\uff0c\u4ee3\u7801\u6781\u5176\u96be\u61c2\uff0c\u5929\u54ea\uff0c\u6211\u7684\u7a0b\u5e8f\u5458\uff0c\u4f60\u7a76\u7adf\u5728\u505a\u4ec0\u4e48?\u4ed4\u7ec6\u770b\u770b\u8fd9\u7bc7\u6307\u5357\uff0c\u8ba9\u6211\u4eec\u4e00\u8d77\u5199\u51fa\u4f18\u96c5\u7684\u9762\u5411\u5bf9\u8c61\u7684JavaScript\u4ee3\u7801\u5427!<\/p>\n<p>\u3000\u3000\u4f5c\u4e3a\u4e00\u4e2a\u5f00\u53d1\u8005\uff0c\u80fd\u5426\u5199\u51fa\u4f18\u96c5\u7684\u4ee3\u7801\u5bf9\u4e8e\u4f60\u7684\u804c\u4e1a\u751f\u6daf\u81f3\u5173\u91cd\u8981\u3002\u968f\u7740\u50cfNode.js\u8fd9\u7c7b\u6280\u672f\u7684\u53d1\u5c55\uff0c\u4f60\u751a\u81f3\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u7aef\u4f7f\u7528JavaScript\u4e86\u3002\u540c\u6837\u7684\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528JavaScript\u6765\u63a7\u5236MongoDB\u7684\u6301\u7eed\u6570\u636e\u5b58\u50a8\u3002<\/p>\n<p><strong>\u3000\u3000\u6587\u672c\u6807\u8bb0<\/strong><\/p>\n<p>\u3000\u3000\u6587\u672c\u6807\u8bb0\u53ea\u662fJavaScript\u91cc\u521b\u5efa\u5bf9\u8c61\u7684\u4e00\u79cd\u65b9\u6cd5\uff0c\u5f53\u7136\u8fd9\u91cc\u80af\u5b9a\u4e0d\u6b62\u8fd9\u4e00\u79cd\uff0c\u4f46\u5b83\u662f\u4f60\u5728\u53ea\u6253\u7b97\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\u5b9e\u4f8b\u65f6\u7684\u9996\u9009\u65b9\u6cd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var bill = {};<\/span><\/p>\n<p>\u3000\u3000\u4e0a\u9762\u7684\u4ee3\u7801\u5e76\u4e0d\u5b9e\u7528\uff0c\u5b83\u53ea\u662f\u4e00\u4e2a\u7a7a\u5bf9\u8c61\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u52a8\u6001\u5730\u5411\u8fd9\u4e2a\u5bf9\u8c61\u4e2d\u6dfb\u52a0\u4e00\u4e9b\u5c5e\u6027\u548c\u65b9\u6cd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.name = &quot;Bill E Goat&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sound = function() {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000console.log( &#39;bahhh!&#39; );<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u8fd9\u91cc\u6dfb\u52a0\u4e86\u5c5e\u6027name\uff0c\u5e76\u4e14\u7ed9\u5b83\u5206\u914d\u4e86\u503c&quot;Bill E Goat&quot;\u3002\u6211\u4eec\u5e76\u4e0d\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u7a7a\u5bf9\u8c61\uff0c\u800c\u53ef\u4ee5\u628a\u6240\u6709\u4ee3\u7801\u76f4\u63a5\u5199\u5728\u4e00\u5bf9\u62ec\u53f7\u91cc\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var bill = {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000name: &quot;Bill E Goat&quot;,<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sound: function() {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000console.log( &#39;bahhh!&#39; );<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000}<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u662f\u4e0d\u662f\u5f88\u7f8e\u89c2?\u8bbf\u95ee\u5b83\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u5c31\u50cf\u547c\u5438\u4e00\u6837\u7b80\u5355\u3001\u81ea\u7136\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.name; \/\/ &quot;Bill E Goat&quot;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sound(); \/\/ &quot;bahhh&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u5982\u679c\u5c5e\u6027\u540d\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684\u6807\u5fd7\u7b26\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u8fd9\u6837\u8bbf\u95ee\u5b83\uff1a<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill[&#39;name&#39;]; \/\/ &quot;Bill E Goat&quot;<\/span><\/p>\n<p>\u3000\u3000\u6ce8\u610f\uff1a\u6211\u5728\u8c03\u7528\u65b9\u6cd5\u65f6\u5728\u5176\u540e\u6dfb\u52a0\u4e86\u5706\u62ec\u53f7\u3002\u73b0\u5728\uff0c\u6211\u4eec\u518d\u91cd\u5199\u4e00\u4e0b\u5f53\u524d\u7684sound\u65b9\u6cd5\uff0c\u5e76\u6dfb\u52a0\u4e00\u4e2a\u53c2\u6570\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sound = function(noise) {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000console.log(noise);<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sound(&quot;brrr!&quot;); \/\/ &quot;brrr!&quot; He&#39;s cold <img src=\"http:\/\/www.qyuef.com\/wp-content\/themes\/2022072007404724\/img\/smilies\/icon_smile.gif\" alt=\":)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u5f88\u597d\uff0c\u6211\u4eec\u5df2\u7ecf\u4f20\u5165\u53c2\u6570\u4e86\uff0c\u5e76\u4e14\u5728\u65b9\u6cd5\u5b9a\u4e49\u4e2d\u8bbf\u95ee\u4e86\u5b83\u3002\u63a5\u4e0b\u6765\uff0c\u5411\u5bf9\u8c61\u4e2d\u589e\u52a0\u4e00\u4e2a\u65b0\u65b9\u6cd5\u6765\u8bbf\u95eename\u5c5e\u6027\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sayName = function() {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000console.log( &quot;Hello &quot; + this.name );<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sayName(); \/\/ &quot;Hello Bill E Goat&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528this.propertyName(\u5728\u672c\u4f8b\u4e2d\u5373this.name)\u5728\u65b9\u6cd5\u5185\u8bbf\u95ee\u5c5e\u6027\u3002<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sayName; \/\/ function<\/span><\/p>\n<p>\u3000\u3000\u600e\u4e48\u56de\u4e8b?\u8bbf\u95eesayName\u65b9\u6cd5\u8fd4\u56de\u4e86\u4e00\u4e2a\u65b9\u6cd5\u5b9a\u4e49\u3002\u73b0\u5728\u8ba9\u6211\u4eec\u518d\u6df1\u5165\u4e9b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var sound = bill.sound;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sound(&#39;moo!&#39;); \/\/ &quot;moo!&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u73b0\u5728\u6211\u4eec\u6307\u5b9a\u4e86sound\u65b9\u6cd5\u4e3a\u4e00\u4e2a\u5c40\u90e8\u51fd\u6570\uff0c\u53ef\u4ee5\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570\u5e76\u4e14\u4f20\u9012\u53c2\u6570\u3002\u4f60\u8ba4\u4e3a\u5728\u590d\u5236bill\u7684\u65f6\u5019\u4f1a\u53d1\u751f\u4ec0\u4e48?(\u7c7b\u6bd4\u4e0b\u514b\u9686\u7f8aDolly)<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var sally = bill;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sally.name; \/\/ &quot;Bill E Goat&quot;\uff0c\u53ef\u5b83\u7684\u540d\u5b57\u662fSally<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sally.name = &quot;Sally&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sally.name; \/\/ &quot;Sally&quot;\uff0c\u597d\u4e9b\u4e86<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.name; \/\/ &quot;Sally&quot;\uff0c\u95ee\u9898\u53c8\u8f6c\u79fb\u5230bill\u8eab\u4e0a\u4e86<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\u6211\u4eec\u65b0\u5efa\u4e86\u4e00\u4e2a\u53d8\u91cfsally\uff0c\u5e76\u4f7f\u5b83\u548cbill\u76f8\u540c\uff0c\u6240\u4ee5bill\u548csally\u4f1a\u5728\u5185\u5b58\u4e2d\u5f15\u7528\u4e86\u540c\u4e00\u4e2a\u5bf9\u8c61\u3002\u8fd9\u65f6\u5019\u7ed9\u6539\u53d8\u4e00\u5757\u5b83\u4eec\u5c31\u4f1a\u540c\u65f6\u53d1\u751f\u6539\u53d8\u3002\u518d\u770b\u770b\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.name = &quot;Bill E Goat&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000bill.sayName(); \/\/ &quot;Hello Bill E Goat&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var sayName = bill.sayName;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sayName; \/\/ function \u76ee\u524d\u4e3a\u6b62\u4e00\u5207\u987a\u5229<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sayName(); \/\/ &quot;Hello &quot;\uff0c\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u53c8\u4e0d\u518d\u663e\u793abill\u7684\u540d\u5b57\u4e86?<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000bill\u7684name\u662f\u4e00\u4e2a\u672c\u5730\u5b9e\u4f8b\u53d8\u91cf\uff0c\u53ea\u5bf9bill\u53ef\u5f97\u3002\u5f53sayName\u65b9\u6cd5\u88ab\u521b\u5efa\u4e3a\u5168\u5c40\u53d8\u91cf\u65f6\uff0c\u5f53\u5b83\u78b0\u5230this.name\u58f0\u660e\u65f6\uff0c\u5b83\u4f1a\u5728\u5168\u5c40\u67e5\u627ename\u7684\u503c\u3002\u552f\u4e00\u7684\u95ee\u9898\u5728\u4e8ename\u8fd8\u6ca1\u6709\u88ab\u5b9a\u4e49\u3002\u73b0\u5728\u8ba9\u6211\u4eec\u5728\u5168\u5c40\u5b9a\u4e49name\uff0c\u770b\u770b\u4f1a\u53d1\u751f\u4ec0\u4e48\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var name = &quot;Bearded Octo&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000sayName(); \/\/ &quot;Hello Bearded Octo&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u8fd9\u91cc\u6211\u4eec\u5728\u5168\u5c40\u8303\u56f4\u5185\u5b9a\u4e49\u4e86name\u53d8\u91cf\uff0c\u5e76\u4e14\u8d4b\u4e88\u4e86\u503c&quot;Bearded Octo&quot;\u3002\u5f53\u6211\u4eec\u5728\u8c03\u7528sayHello\u65b9\u6cd5\u65f6\u5b83\u4f1a\u5728\u5168\u5c40\u8303\u56f4\u5185\u67e5\u627ename\u53d8\u91cf\uff0c\u6700\u7ec8\u4f1a\u83b7\u5f97\u503c&quot;Bearded Octo&quot;\u3002\u6211\u4eec\u4e3a\u4ec0\u4e48\u4e0d\u4e3a\u8fd9\u51e0\u4e2a\u5bf9\u8c61\u5efa\u7acb\u4e00\u4e2a\u5171\u540c\u7684&ldquo;\u7c7b&rdquo;\u5462?<\/p>\n<p><strong>\u3000\u3000\u6784\u9020\u51fd\u6570<\/strong><\/p>\n<p>\u3000\u3000\u6784\u9020\u51fd\u6570\u662f\u53e6\u4e00\u4e2a\u7f16\u5199\u9762\u5411\u5bf9\u8c61JavaScript\u4ee3\u7801\u7684\u65b9\u6cd5\uff0c\u5f53\u4f60\u9700\u8981\u521d\u59cb\u5316\u5bf9\u8c61\u7684\u5c5e\u6027\u3001\u65b9\u6cd5\uff0c\u6216\u8005\u9700\u8981\u521b\u5efa\u591a\u4e2a\u5c5e\u6027\u3001\u65b9\u6cd5\u5404\u4e0d\u76f8\u540c\u7684\u5b9e\u4f8b\u65f6\uff0c\u5b83\u5c06\u662f\u4f60\u6700\u4f73\u7684\u9009\u62e9\u3002\u540c\u6837\u6211\u4eec\u5148\u4ece\u521b\u5efa\u4e00\u4e2a\u7a7a\u5bf9\u8c61\u5f00\u59cb\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000function Game() {};<\/span><\/p>\n<p>\u3000\u3000\u8fd9\u4e2a\u5bf9\u8c61\u5305\u62ec\u81ea\u5df1\u7684\u5c5e\u6027\uff0c\u4f60\u751a\u81f3\u53ef\u4ee5\u5728\u521b\u5efa\u5bf9\u8c61\u65f6\u4f20\u5165\u5c5e\u6027\uff0c\u7136\u540e\u518d\u5bf9\u5176\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var zelda = new Game();<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var smb = new Game();<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.title = &quot;Legend of Zelda&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000smb.title = &quot;Super Mario Brothers&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.title; \/\/ &quot;Legend of Zelda&quot;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000smb.title; \/\/ &quot;Super Mario Brothers&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u73b0\u5728\u8fd9\u4e2a\u5bf9\u8c61\u5df2\u7ecf\u6709\u81ea\u5df1\u7684\u65b9\u6cd5\u4e86!\u65b0\u521b\u5efa\u5bf9\u8c61\u65f6\u6211\u4eec\u751a\u81f3\u53ef\u4ee5\u4f20\u9012\u5c5e\u6027\uff0c\u4e4b\u540e\u518d\u4fee\u6539\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000function Game(title) {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000this.title = typeof title !== &#39;undefined&#39; ? title : &quot;&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var zelda = new Game(&quot;Legend of Zelda&quot;);<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.title; \/\/ &quot;Legend of Zelda&quot;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.title = &quot;Ocarina of Time&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.title; \/\/ &quot;Ocarina of Time&quot;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000var blank = new Game();<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000blank.title; \/\/ &quot;&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u4e5f\u8bb8\u4f60\u6ca1\u770b\u660e\u767d\u7b2c\u4e8c\u884c\u7684\u5185\u5bb9\uff0c\u5176\u5b9e\u662f\u4f7f\u7528\u4e86\u4e09\u5143\u64cd\u4f5c\u6765\u907f\u514d\u5355\u884c\u7684if else\uff0c\u5b83\u548c\u4e0b\u9762\u6807\u51c6\u7684if else\u8bed\u53e5\u662f\u4e00\u4e2a\u610f\u601d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000if (typeof title !== &#39;undefined&#39;) {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000this.title = title;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000} else {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000this.title = &quot;&quot;;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000}<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000\/\/ Is the same as<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000this.title = typeof title !== &#39;undefined&#39; ? title : &quot;&quot;;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u5982\u679ctitle\u53d8\u91cf\u5728\u5bf9\u8c61\u88ab\u521b\u5efa\u65f6\u4f20\u5165\uff0ctitle\u5b9e\u4f8b\u53d8\u91cf\u5c06\u4f1a\u6307\u5b9a\u4e3atitle\u7684\u503c\u3002\u5982\u679c\u6ca1\u6709\u503c\u4f20\u5165\uff0c\u90a3\u4e48title\u5c06\u4f1a\u88ab\u521d\u59cb\u5316\u4e3a\u9ed8\u8ba4\u503c&quot;&quot;\u3002\u6211\u4eec\u540c\u6837\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b9\u6cd5\u6765\u8bbf\u95ee\u8fd9\u4e2a\u5c5e\u6027\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.loveTitle = function() {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000console.log( &quot;I love &quot; + this.title );<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.loveTitle(); \/\/ &quot;I love Ocarina of Time&quot;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3000\u3000\u8fd9\u6837\u5c31\u5f88\u6574\u6d01\u4e86\uff0c\u4f46\u662f\u6211\u4eec\u8fd8\u80fd\u505a\u5f97\u66f4\u597d\u3002\u6211\u4eec\u53ef\u4ee5\u5728Game\u7c7b\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b9\u6cd5\uff0c\u8fd9\u6837\u6240\u6709Game\u7c7b\u7684\u5b9e\u4f8b\u5c06\u90fd\u80fd\u4f7f\u7528\u6b64\u65b9\u6cd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000Game.prototype.heartIt = function() {<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000console.log( &quot;I heart &quot; + this.title );<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000};<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000zelda.heartIt(); \/\/ &quot;I heart Ocarina of Time&quot;<\/span><\/p>\n<p><span style=\"color: rgb(0,128,0)\">\u3000\u3000smb.heartIt(); \/\/ &quot;I heart Super Mario Brothers&quot;<\/span><\/p>\n<p><!--\u5185\u5bb9\u5173\u8054\u6295\u7968--><!-- articleBody end --><!-- numpage start --><\/p>\n<div class=\"pages\">\n<div id=\"numpage\">&nbsp;<\/div>\n<\/div>\n<p><!-- numpage end --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5230\u5904\u90fd\u662f\u5c5e\u6027\u3001\u65b9\u6cd5\uff0c\u4ee3\u7801\u6781\u5176\u96be\u61c2\uff0c\u5929\u54ea\uff0c\u6211\u7684\u7a0b\u5e8f\u5458\uff0c\u4f60\u7a76\u7adf\u5728\u505a\u4ec0\u4e48?\u4ed4\u7ec6\u770b\u770b\u8fd9\u7bc7\u6307\u5357\uff0c\u8ba9\u6211\u4eec\u4e00\u8d77\u5199\u51fa\u4f18\u96c5\u7684\u9762\u5411\u5bf9\u8c61\u7684JavaScript\u4ee3\u7801\u5427! \u3000\u3000\u4f5c\u4e3a\u4e00\u4e2a\u5f00\u53d1\u8005\uff0c\u80fd\u5426\u5199\u51fa\u4f18\u96c5\u7684\u4ee3\u7801\u5bf9\u4e8e\u4f60\u7684\u804c\u4e1a\u751f\u6daf\u81f3\u5173\u91cd\u8981\u3002\u968f\u7740\u50cfNode.js\u8fd9\u7c7b\u6280\u672f\u7684<a rel=\"nofollow\" class=\"more-link\" style=\"text-decoration:none;\" href=\"http:\/\/www.qyuef.com\/?p=447\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"tcat":[],"_links":{"self":[{"href":"http:\/\/www.qyuef.com\/index.php?rest_route=\/wp\/v2\/posts\/447"}],"collection":[{"href":"http:\/\/www.qyuef.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.qyuef.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.qyuef.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.qyuef.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=447"}],"version-history":[{"count":0,"href":"http:\/\/www.qyuef.com\/index.php?rest_route=\/wp\/v2\/posts\/447\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.qyuef.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.qyuef.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.qyuef.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=447"},{"taxonomy":"tcat","embeddable":true,"href":"http:\/\/www.qyuef.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftcat&post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}