{"id":126,"date":"2022-07-24T11:28:59","date_gmt":"2022-07-24T11:28:59","guid":{"rendered":"https:\/\/hugohabor.com\/?p=126"},"modified":"2022-11-04T09:12:27","modified_gmt":"2022-11-04T09:12:27","slug":"js-%e4%bd%9c%e7%94%a8%e5%9f%9f%e6%8e%a2%e8%a8%8e-%e8%a7%a3%e6%9e%90-day1","status":"publish","type":"post","link":"https:\/\/hugohabor.com\/?p=126","title":{"rendered":"JS \u4f5c\u7528\u57df\u63a2\u8a0e"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df <\/p>\n<cite>\u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002<\/cite><\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u8b8a\u6578\u4f5c\u7528\u57df\u4e5f\u6703\u4f9d\u64da\u5ba3\u544a\u7684\u65b9\u5f0f\u4e0d\u540c\uff0c\u7522\u751f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\uff1a<br>\u672a\u5ba3\u544a\uff1a\u5168\u57df\u8b8a\u6578<br><code>var<\/code>\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0<strong>\u51fd\u5f0f<\/strong>\u00a0\u4e2d<br><code>let<\/code>\u3001<code>const<\/code>\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0<code>{}<\/code>\u00a0\u4e2d<\/p><\/blockquote><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"512\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?resize=1024%2C512&#038;ssl=1\" alt=\"\" class=\"wp-image-127\" srcset=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?resize=1024%2C512&amp;ssl=1 1024w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?resize=300%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?resize=768%2C384&amp;ssl=1 768w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?resize=1200%2C600&amp;ssl=1 1200w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?w=1245&amp;ssl=1 1245w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"478\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F02.png?resize=1024%2C478&#038;ssl=1\" alt=\"\" class=\"wp-image-128\" srcset=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F02.png?resize=1024%2C478&amp;ssl=1 1024w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F02.png?resize=300%2C140&amp;ssl=1 300w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F02.png?resize=768%2C358&amp;ssl=1 768w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F02.png?w=1158&amp;ssl=1 1158w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u7bc4\u4f8b1<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F04_%E5%9C%A8%E7%92%B0%E5%A2%83%E5%A4%96%E8%AE%80%E5%8F%96.png?resize=516%2C479&#038;ssl=1\" alt=\"\" class=\"wp-image-129\" width=\"516\" height=\"479\" srcset=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F04_%E5%9C%A8%E7%92%B0%E5%A2%83%E5%A4%96%E8%AE%80%E5%8F%96.png?w=516&amp;ssl=1 516w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F04_%E5%9C%A8%E7%92%B0%E5%A2%83%E5%A4%96%E8%AE%80%E5%8F%96.png?resize=300%2C278&amp;ssl=1 300w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"386\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F03_%E5%80%BC%E6%9C%AA%E8%A2%AB%E8%B3%A6%E4%BA%88.png?resize=1024%2C386&#038;ssl=1\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F03_%E5%80%BC%E6%9C%AA%E8%A2%AB%E8%B3%A6%E4%BA%88.png?resize=1024%2C386&amp;ssl=1 1024w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F03_%E5%80%BC%E6%9C%AA%E8%A2%AB%E8%B3%A6%E4%BA%88.png?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F03_%E5%80%BC%E6%9C%AA%E8%A2%AB%E8%B3%A6%E4%BA%88.png?resize=768%2C289&amp;ssl=1 768w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F03_%E5%80%BC%E6%9C%AA%E8%A2%AB%E8%B3%A6%E4%BA%88.png?resize=1200%2C452&amp;ssl=1 1200w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F03_%E5%80%BC%E6%9C%AA%E8%A2%AB%E8%B3%A6%E4%BA%88.png?w=1324&amp;ssl=1 1324w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: <strong>Uncaught ReferenceError value is not defined<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u539f\u56e0: <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u7bc4\u4f8b2<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#8217;\u5f35\u5c0f\u59d0&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"495\" height=\"465\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F05_%E8%AE%80%E5%8F%96%E5%85%A8%E5%9F%9F%E5%80%BC.png?resize=495%2C465&#038;ssl=1\" alt=\"\" class=\"wp-image-132\" srcset=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F05_%E8%AE%80%E5%8F%96%E5%85%A8%E5%9F%9F%E5%80%BC.png?w=495&amp;ssl=1 495w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F05_%E8%AE%80%E5%8F%96%E5%85%A8%E5%9F%9F%E5%80%BC.png?resize=300%2C282&amp;ssl=1 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u539f\u56e0:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"> call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"712\" height=\"483\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F06_%E8%AE%80%E5%8F%96%E5%85%A8%E5%9F%9F%E5%80%BC.png?resize=712%2C483&#038;ssl=1\" alt=\"\" class=\"wp-image-134\" srcset=\"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F06_%E8%AE%80%E5%8F%96%E5%85%A8%E5%9F%9F%E5%80%BC.png?w=712&amp;ssl=1 712w, https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F06_%E8%AE%80%E5%8F%96%E5%85%A8%E5%9F%9F%E5%80%BC.png?resize=300%2C204&amp;ssl=1 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u4ee5\u4e0a\u5c31\u662f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\u4e4b\u9593\u7684\u95dc\u4fc2, \u5e0c\u671b\u5927\u5bb6\u4e0d\u8981\u641e\u6df7\u4e86\u3002<\/p><\/blockquote><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8b8a\u6578\u4f5c\u7528\u57df\u4e5f\u6703\u4f9d\u64da\u5ba3\u544a\u7684\u65b9\u5f0f\u4e0d\u540c\uff0c\u7522\u751f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\uff1a\u672a\u5ba3\u544a\uff1a\u5168\u57df\u8b8a\u6578var\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0\u51fd\u5f0f\u00a0\u4e2dlet\u3001const\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0{}\u00a0\u4e2d JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#8217;\u5f35\u5c0f\u59d0&#8217; \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c \u4ee5\u4e0a\u5c31\u662f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\u4e4b\u9593\u7684\u95dc\u4fc2, \u5e0c\u671b\u5927\u5bb6\u4e0d\u8981\u641e\u6df7\u4e86\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_eb_attr":"","WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_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":[6],"tags":[9,10],"class_list":["post-126","post","type-post","status-publish","format-standard","hentry","category-js_learning","tag-js","tag-lexical-scope"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#039;\u5f35\u5c0f\u59d0&#039; \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"lioajimzen\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/hugohabor.com\/?p=126\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Hugo Habor -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor\" \/>\n\t\t<meta property=\"og:description\" content=\"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#039;\u5f35\u5c0f\u59d0&#039; \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/hugohabor.com\/?p=126\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-07-24T11:28:59+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-11-04T09:12:27+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#039;\u5f35\u5c0f\u59d0&#039; \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#blogposting\",\"name\":\"JS \\u4f5c\\u7528\\u57df\\u63a2\\u8a0e - Hugo Habor\",\"headline\":\"JS \\u4f5c\\u7528\\u57df\\u63a2\\u8a0e\",\"author\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/hugohabor.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?fit=1245%2C623&ssl=1\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126\\\/#articleImage\",\"width\":1245,\"height\":623},\"datePublished\":\"2022-07-24T11:28:59+00:00\",\"dateModified\":\"2022-11-04T09:12:27+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#webpage\"},\"articleSection\":\"Front-End JavaScript, JS, Lexical Scope\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hugohabor.com\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?cat=6#listItem\",\"name\":\"Front-End JavaScript\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?cat=6#listItem\",\"position\":2,\"name\":\"Front-End JavaScript\",\"item\":\"https:\\\/\\\/hugohabor.com\\\/?cat=6\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#listItem\",\"name\":\"JS \\u4f5c\\u7528\\u57df\\u63a2\\u8a0e\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#listItem\",\"position\":3,\"name\":\"JS \\u4f5c\\u7528\\u57df\\u63a2\\u8a0e\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?cat=6#listItem\",\"name\":\"Front-End JavaScript\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#organization\",\"name\":\"Hugo Habor\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/?author=1\",\"name\":\"lioajimzen\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"lioajimzen\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#webpage\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/?p=126\",\"name\":\"JS \\u4f5c\\u7528\\u57df\\u63a2\\u8a0e - Hugo Habor\",\"description\":\"\\u8a9e\\u6cd5\\u4f5c\\u7528\\u57df = \\u975c\\u614b\\u4f5c\\u7528\\u57df \\u975c\\u614b\\u4f5c\\u7528\\u57df \\u53ca \\u52d5\\u614b\\u4f5c\\u7528\\u57df \\u4e4b\\u9593\\u7684\\u5dee\\u5225\\u727d\\u6d89\\u76f4\\u8b6f\\u8a9e\\u8a00\\u7684\\u89e3\\u8b6f\\u53ca\\u904b\\u884c\\u6d41\\u7a0b\\u3002 \\u8cc7\\u6599\\u53c3\\u8003: \\u516d\\u89d2\\u5b78\\u9662 JavaScript \\u6838\\u5fc3\\u7bc7 JS \\u63a1\\u7528\\u7684\\u662f\\u8a9e\\u6cd5\\u4f5c\\u7528\\u57df, \\u53ea\\u8981\\u78ba\\u5b9a\\u4f60\\u7684\\u4f5c\\u7528\\u57df, \\u5c31\\u4e0d\\u6703\\u518d\\u6539\\u8b8a\\u3002 \\u7bc4\\u4f8b1 \\u7bc4\\u4f8b1 \\u6e2c\\u8a66\\u7d50\\u679c\\u5982\\u4e0b: \\u5229\\u7528\\u5168\\u57dfconsole.log() \\u53bb\\u6e2c\\u8a66, \\u53ef\\u5426\\u986f\\u793a\\u51fd\\u5f0f callname()\\u4f5c\\u7528\\u57df\\u7684\\u503c\\u3002 \\u986f\\u793a\\u51fa\\u4f86\\u7684\\u7d50\\u679c callname()\\u4f5c\\u7528\\u57df\\u7684\\u8b8a\\u6578value, \\u7528\\u5916\\u5c64console.log \\u53bb\\u8b80\\u53d6\\u6703\\u5f97\\u5230: Uncaught ReferenceError value is not defined \\u539f\\u56e0: \\u5168\\u57dfconsole.log() \\u7121\\u6cd5\\u53bb callname() \\u4f5c\\u7528\\u57df\\u53bb\\u8b80\\u53d6\\u8a72\\u8b8a\\u6578! \\u7bc4\\u4f8b2 \\u6b64\\u7bc4\\u4f8b\\u6211\\u5011\\u52a0\\u5165\\u5168\\u57df\\u8b8a\\u6578 let name ='\\u5f35\\u5c0f\\u59d0' \\u6211\\u5011\\u6703\\u77e5\\u9053\\u6700\\u5f8c\\u88ab\\u57f7\\u884c\\u7684call2()\\u51fd\\u5f0f \\u539f\\u56e0: call2()\\u51fd\\u5f0f\\u5167\\u90e8\\u6709\\u547c\\u53eb callname() \\u51fd\\u5f0f, \\u800ccallname()\\u51fd\\u5f0f\\u4f5c\\u7528\\u57df\\u5167\\u4e26\\u6c92\\u6709\\u5ba3\\u544aname\\u8b8a\\u6578, \\u6240\\u4ee5callname() \\u51fd\\u5f0f\\u6703\\u53bb\\u5168\\u57df\\u8b8a\\u6578\\u67e5\\u627ename\\u503c(\\u7da0\\u8272\\u7bad\\u982d\\u90e8\\u5206) \\u3002 \\u986f\\u793a\\u51fa\\u4f86\\u7684\\u7d50\\u679c\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\"},\"datePublished\":\"2022-07-24T11:28:59+00:00\",\"dateModified\":\"2022-11-04T09:12:27+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#website\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/\",\"name\":\"Hugo Habor\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","description":"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name ='\u5f35\u5c0f\u59d0' \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c","canonical_url":"https:\/\/hugohabor.com\/?p=126","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/hugohabor.com\/?p=126#blogposting","name":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","headline":"JS \u4f5c\u7528\u57df\u63a2\u8a0e","author":{"@id":"https:\/\/hugohabor.com\/?author=1#author"},"publisher":{"@id":"https:\/\/hugohabor.com\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2022\/07\/js_%E8%AA%9E%E6%B3%95%E4%BD%9C%E7%94%A8%E5%9F%9F01.png?fit=1245%2C623&ssl=1","@id":"https:\/\/hugohabor.com\/?p=126\/#articleImage","width":1245,"height":623},"datePublished":"2022-07-24T11:28:59+00:00","dateModified":"2022-11-04T09:12:27+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/hugohabor.com\/?p=126#webpage"},"isPartOf":{"@id":"https:\/\/hugohabor.com\/?p=126#webpage"},"articleSection":"Front-End JavaScript, JS, Lexical Scope"},{"@type":"BreadcrumbList","@id":"https:\/\/hugohabor.com\/?p=126#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/#listItem","position":1,"name":"Home","item":"https:\/\/hugohabor.com\/","nextItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?cat=6#listItem","name":"Front-End JavaScript"}},{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?cat=6#listItem","position":2,"name":"Front-End JavaScript","item":"https:\/\/hugohabor.com\/?cat=6","nextItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?p=126#listItem","name":"JS \u4f5c\u7528\u57df\u63a2\u8a0e"},"previousItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?p=126#listItem","position":3,"name":"JS \u4f5c\u7528\u57df\u63a2\u8a0e","previousItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?cat=6#listItem","name":"Front-End JavaScript"}}]},{"@type":"Organization","@id":"https:\/\/hugohabor.com\/#organization","name":"Hugo Habor","url":"https:\/\/hugohabor.com\/"},{"@type":"Person","@id":"https:\/\/hugohabor.com\/?author=1#author","url":"https:\/\/hugohabor.com\/?author=1","name":"lioajimzen","image":{"@type":"ImageObject","@id":"https:\/\/hugohabor.com\/?p=126#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","width":96,"height":96,"caption":"lioajimzen"}},{"@type":"WebPage","@id":"https:\/\/hugohabor.com\/?p=126#webpage","url":"https:\/\/hugohabor.com\/?p=126","name":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","description":"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name ='\u5f35\u5c0f\u59d0' \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/hugohabor.com\/#website"},"breadcrumb":{"@id":"https:\/\/hugohabor.com\/?p=126#breadcrumblist"},"author":{"@id":"https:\/\/hugohabor.com\/?author=1#author"},"creator":{"@id":"https:\/\/hugohabor.com\/?author=1#author"},"datePublished":"2022-07-24T11:28:59+00:00","dateModified":"2022-11-04T09:12:27+00:00"},{"@type":"WebSite","@id":"https:\/\/hugohabor.com\/#website","url":"https:\/\/hugohabor.com\/","name":"Hugo Habor","inLanguage":"en-US","publisher":{"@id":"https:\/\/hugohabor.com\/#organization"}}]},"og:locale":"en_US","og:site_name":"Hugo Habor -","og:type":"article","og:title":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","og:description":"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name ='\u5f35\u5c0f\u59d0' \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c","og:url":"https:\/\/hugohabor.com\/?p=126","og:image":"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg","og:image:secure_url":"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg","og:image:width":960,"og:image:height":960,"article:published_time":"2022-07-24T11:28:59+00:00","article:modified_time":"2022-11-04T09:12:27+00:00","twitter:card":"summary_large_image","twitter:title":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","twitter:description":"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8cc7\u6599\u53c3\u8003: \u516d\u89d2\u5b78\u9662 JavaScript \u6838\u5fc3\u7bc7 JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name ='\u5f35\u5c0f\u59d0' \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c","twitter:image":"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg"},"aioseo_meta_data":{"post_id":"126","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2026-03-09 19:03:23","updated":"2026-03-09 19:03:23","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/hugohabor.com\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/hugohabor.com\/?cat=6\" title=\"Front-End JavaScript\">Front-End JavaScript<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tJS \u4f5c\u7528\u57df\u63a2\u8a0e\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/hugohabor.com\/"},{"label":"Front-End JavaScript","link":"https:\/\/hugohabor.com\/?cat=6"},{"label":"JS \u4f5c\u7528\u57df\u63a2\u8a0e","link":"https:\/\/hugohabor.com\/?p=126"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hugohabor.com\/?p=126\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor\" \/>\n<meta property=\"og:description\" content=\"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8b8a\u6578\u4f5c\u7528\u57df\u4e5f\u6703\u4f9d\u64da\u5ba3\u544a\u7684\u65b9\u5f0f\u4e0d\u540c\uff0c\u7522\u751f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\uff1a\u672a\u5ba3\u544a\uff1a\u5168\u57df\u8b8a\u6578var\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0\u51fd\u5f0f\u00a0\u4e2dlet\u3001const\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0{}\u00a0\u4e2d JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#8217;\u5f35\u5c0f\u59d0&#8217; \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c \u4ee5\u4e0a\u5c31\u662f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\u4e4b\u9593\u7684\u95dc\u4fc2, \u5e0c\u671b\u5927\u5bb6\u4e0d\u8981\u641e\u6df7\u4e86\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hugohabor.com\/?p=126\" \/>\n<meta property=\"og:site_name\" content=\"Hugo Habor\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-24T11:28:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-04T09:12:27+00:00\" \/>\n<meta name=\"author\" content=\"lioajimzen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"lioajimzen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126\"},\"author\":{\"name\":\"lioajimzen\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/person\\\/d87a724a8ca78e641cda8de55cf2114b\"},\"headline\":\"JS \u4f5c\u7528\u57df\u63a2\u8a0e\",\"datePublished\":\"2022-07-24T11:28:59+00:00\",\"dateModified\":\"2022-11-04T09:12:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126\"},\"wordCount\":28,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#organization\"},\"keywords\":[\"JS\",\"Lexical Scope\"],\"articleSection\":[\"Front-End JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hugohabor.com\\\/?p=126#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/?p=126\",\"name\":\"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#website\"},\"datePublished\":\"2022-07-24T11:28:59+00:00\",\"dateModified\":\"2022-11-04T09:12:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hugohabor.com\\\/?p=126\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=126#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hugohabor.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JS \u4f5c\u7528\u57df\u63a2\u8a0e\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#website\",\"url\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/\",\"name\":\"Hugo Habor\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#organization\",\"name\":\"Hugo Habor\",\"url\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/hugohabor.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/hugohabor.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1\",\"width\":960,\"height\":960,\"caption\":\"Hugo Habor\"},\"image\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/person\\\/d87a724a8ca78e641cda8de55cf2114b\",\"name\":\"lioajimzen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"caption\":\"lioajimzen\"},\"url\":\"https:\\\/\\\/hugohabor.com\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hugohabor.com\/?p=126","og_locale":"en_US","og_type":"article","og_title":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","og_description":"\u8a9e\u6cd5\u4f5c\u7528\u57df = \u975c\u614b\u4f5c\u7528\u57df \u975c\u614b\u4f5c\u7528\u57df \u53ca \u52d5\u614b\u4f5c\u7528\u57df \u4e4b\u9593\u7684\u5dee\u5225\u727d\u6d89\u76f4\u8b6f\u8a9e\u8a00\u7684\u89e3\u8b6f\u53ca\u904b\u884c\u6d41\u7a0b\u3002 \u8b8a\u6578\u4f5c\u7528\u57df\u4e5f\u6703\u4f9d\u64da\u5ba3\u544a\u7684\u65b9\u5f0f\u4e0d\u540c\uff0c\u7522\u751f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\uff1a\u672a\u5ba3\u544a\uff1a\u5168\u57df\u8b8a\u6578var\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0\u51fd\u5f0f\u00a0\u4e2dlet\u3001const\u00a0\u5ba3\u544a\uff1a\u4f5c\u7528\u57df\u5728\u00a0{}\u00a0\u4e2d JS \u63a1\u7528\u7684\u662f\u8a9e\u6cd5\u4f5c\u7528\u57df, \u53ea\u8981\u78ba\u5b9a\u4f60\u7684\u4f5c\u7528\u57df, \u5c31\u4e0d\u6703\u518d\u6539\u8b8a\u3002 \u7bc4\u4f8b1 \u7bc4\u4f8b1 \u6e2c\u8a66\u7d50\u679c\u5982\u4e0b: \u5229\u7528\u5168\u57dfconsole.log() \u53bb\u6e2c\u8a66, \u53ef\u5426\u986f\u793a\u51fd\u5f0f callname()\u4f5c\u7528\u57df\u7684\u503c\u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c callname()\u4f5c\u7528\u57df\u7684\u8b8a\u6578value, \u7528\u5916\u5c64console.log \u53bb\u8b80\u53d6\u6703\u5f97\u5230: Uncaught ReferenceError value is not defined \u539f\u56e0: \u5168\u57dfconsole.log() \u7121\u6cd5\u53bb callname() \u4f5c\u7528\u57df\u53bb\u8b80\u53d6\u8a72\u8b8a\u6578! \u7bc4\u4f8b2 \u6b64\u7bc4\u4f8b\u6211\u5011\u52a0\u5165\u5168\u57df\u8b8a\u6578 let name =&#8217;\u5f35\u5c0f\u59d0&#8217; \u6211\u5011\u6703\u77e5\u9053\u6700\u5f8c\u88ab\u57f7\u884c\u7684call2()\u51fd\u5f0f \u539f\u56e0: call2()\u51fd\u5f0f\u5167\u90e8\u6709\u547c\u53eb callname() \u51fd\u5f0f, \u800ccallname()\u51fd\u5f0f\u4f5c\u7528\u57df\u5167\u4e26\u6c92\u6709\u5ba3\u544aname\u8b8a\u6578, \u6240\u4ee5callname() \u51fd\u5f0f\u6703\u53bb\u5168\u57df\u8b8a\u6578\u67e5\u627ename\u503c(\u7da0\u8272\u7bad\u982d\u90e8\u5206) \u3002 \u986f\u793a\u51fa\u4f86\u7684\u7d50\u679c \u4ee5\u4e0a\u5c31\u662f\u4e0d\u540c\u7684\u4f5c\u7528\u57df\u4e4b\u9593\u7684\u95dc\u4fc2, \u5e0c\u671b\u5927\u5bb6\u4e0d\u8981\u641e\u6df7\u4e86\u3002","og_url":"https:\/\/hugohabor.com\/?p=126","og_site_name":"Hugo Habor","article_published_time":"2022-07-24T11:28:59+00:00","article_modified_time":"2022-11-04T09:12:27+00:00","author":"lioajimzen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"lioajimzen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hugohabor.com\/?p=126#article","isPartOf":{"@id":"https:\/\/hugohabor.com\/?p=126"},"author":{"name":"lioajimzen","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/person\/d87a724a8ca78e641cda8de55cf2114b"},"headline":"JS \u4f5c\u7528\u57df\u63a2\u8a0e","datePublished":"2022-07-24T11:28:59+00:00","dateModified":"2022-11-04T09:12:27+00:00","mainEntityOfPage":{"@id":"https:\/\/hugohabor.com\/?p=126"},"wordCount":28,"commentCount":0,"publisher":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#organization"},"keywords":["JS","Lexical Scope"],"articleSection":["Front-End JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hugohabor.com\/?p=126#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hugohabor.com\/?p=126","url":"https:\/\/hugohabor.com\/?p=126","name":"JS \u4f5c\u7528\u57df\u63a2\u8a0e - Hugo Habor","isPartOf":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#website"},"datePublished":"2022-07-24T11:28:59+00:00","dateModified":"2022-11-04T09:12:27+00:00","breadcrumb":{"@id":"https:\/\/hugohabor.com\/?p=126#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hugohabor.com\/?p=126"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hugohabor.com\/?p=126#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hugohabor.com\/"},{"@type":"ListItem","position":2,"name":"JS \u4f5c\u7528\u57df\u63a2\u8a0e"}]},{"@type":"WebSite","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#website","url":"http:\/\/box2025.temp.domains\/~hugohabo\/","name":"Hugo Habor","description":"","publisher":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/box2025.temp.domains\/~hugohabo\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#organization","name":"Hugo Habor","url":"http:\/\/box2025.temp.domains\/~hugohabo\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1","contentUrl":"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1","width":960,"height":960,"caption":"Hugo Habor"},"image":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/person\/d87a724a8ca78e641cda8de55cf2114b","name":"lioajimzen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","caption":"lioajimzen"},"url":"https:\/\/hugohabor.com\/?author=1"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=126"}],"version-history":[{"count":5,"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":981,"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions\/981"}],"wp:attachment":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}