{"id":2322,"date":"2023-10-11T16:20:41","date_gmt":"2023-10-11T08:20:41","guid":{"rendered":"https:\/\/white-night.club\/?p=2322"},"modified":"2023-11-09T11:07:50","modified_gmt":"2023-11-09T03:07:50","slug":"ad38","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/10\/11\/ad38\/","title":{"rendered":"2667.\u00a0\u521b\u5efa Hello World \u51fd\u6570"},"content":{"rendered":"\n<p>\u8bf7\u4f60\u7f16\u5199\u4e00\u4e2a\u540d\u4e3a\u00a0<code>createHelloWorld<\/code>\u00a0\u7684\u51fd\u6570\u3002\u5b83\u5e94\u8be5\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u603b\u662f\u8fd4\u56de\u00a0<code>\"Hello World\"<\/code>\u00a0\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>args = []\n<strong>\u8f93\u51fa\uff1a<\/strong>\"Hello World\"\n<strong>\u89e3\u91ca\uff1a<\/strong>\nconst f = createHelloWorld();\nf(); \/\/ \"Hello World\"\n\ncreateHelloWorld \u8fd4\u56de\u7684\u51fd\u6570\u5e94\u59cb\u7ec8\u8fd4\u56de \"Hello World\"\u3002\n<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>args = [{},null,42]\n<strong>\u8f93\u51fa\uff1a<\/strong>\"Hello World\"\n<strong>\u89e3\u91ca\uff1a<\/strong>\nconst f = createHelloWorld();\nf({}, null, 42); \/\/ \"Hello World\"\n\n\u53ef\u4ee5\u4f20\u9012\u4efb\u4f55\u53c2\u6570\u7ed9\u51fd\u6570\uff0c\u4f46\u5b83\u5e94\u59cb\u7ec8\u8fd4\u56de \"Hello World\"\u3002\n<\/pre>\n\n\n\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><code>0 &lt;= args.length &lt;= 10<\/code><\/li>\n<\/ul>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>&#8230;<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u6ee1\u8db3\u4e86\u6211\u5bf9\u524d\u7aefJavaScript\u7684\u60f3\u8c61\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u6bd5\u7adf\u505a\u4e86\uff0c\u8fd8\u662f\u6765\u770b\u770b\u76f8\u5173\u7684\u77e5\u8bc6\u70b9\u5427\u3002<\/p>\n\n\n\n<p>\u53d8\u91cf\u5c31\u50cf\u4e00\u4e2a\u6570\u636e\u7684\u5bb9\u5668\uff0c\u5b83\u5f53\u7136\u53ef\u4ee5\u5b58\u50a8\u4e00\u4e2a\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u6700\u5916\u5c42\u7684\u76f8\u5f53\u4e8e\u9ad8\u9636\u51fd\u6570\uff0c\u4e00\u4e2a\u51fd\u6570A\u53ef\u4ee5\u5c06\u53e6\u4e00\u4e2a\u4f20\u5165\u7684\u51fd\u6570B\u4f5c\u4e3a\u53c2\u6570\uff0c\u90a3\u4e48A\u5c31\u662f\u9ad8\u9636\u51fd\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\r\n * @return {Function}\r\n *\/\r\nvar createHelloWorld = function() {\r\n    \r\n    return function(...args) {\r\n        return \"Hello World\";\r\n    }\r\n};\r\n\r\n\/**\r\n * const f = createHelloWorld();\r\n * f(); \/\/ \"Hello World\"\r\n *\/<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1ajs\u5f31\u667a\u9898<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2322"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=2322"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/2322\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=2322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=2322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}