Title: new调用函数和普通调用函数的区别 · Issue #1 · K0II/JavaScript · GitHub
Open Graph Title: new调用函数和普通调用函数的区别 · Issue #1 · K0II/JavaScript
X Title: new调用函数和普通调用函数的区别 · Issue #1 · K0II/JavaScript
Description: new调用函数和普通调用函数的区别(一) function test() { this.name = 'Test'; return function() { return true; } } var foo = new test(); var bar = test(); typeof foo; // function typeof bar; // function foo; // function() bar; // function() foo.name; // 空字...
Open Graph Description: new调用函数和普通调用函数的区别(一) function test() { this.name = 'Test'; return function() { return true; } } var foo = new test(); var bar = test(); typeof foo; // function typeof bar; // function foo; // funct...
X Description: new调用函数和普通调用函数的区别(一) function test() { this.name = 'Test'; return function() { return true; } } var foo = new test(); var bar = test(); typeof foo; // function typeof bar; // function foo; ...
Opengraph URL: https://github.com/K0II/JavaScript/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"new调用函数和普通调用函数的区别","articleBody":"### new调用函数和普通调用函数的区别(一)\n\n``` javascript\n\nfunction test() {\n this.name = 'Test';\n return function() { return true; }\n}\n\nvar foo = new test();\nvar bar = test();\n\ntypeof foo; // function\ntypeof bar; // function\n\nfoo; // function()\nbar; // function()\n\nfoo.name; // 空字符串\nbar.name; // 空字符串\n\nfoo(); // true\nbar(); // true\n\nfoo === bar; // false\n\nvar baz = test();\nbar === baz; // false\n\n```\n\n各种测试发现,当test函数return的是一个函数的时候没有区别,哪怕`foo === bar; // false` 也不意外\n","author":{"url":"https://github.com/K0II","@type":"Person","name":"K0II"},"datePublished":"2016-05-22T00:34:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1/JavaScript/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:48d4dbb3-aba1-7c33-8292-487d56cb912b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EDC:9D1CD:5984890:7DF4789:6A4FF216 |
| html-safe-nonce | 5480a8ecf6a3941a3b8e98a320338969e3bf5f000ad705c57fcef6e8ceaac21d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RURDOjlEMUNEOjU5ODQ4OTA6N0RGNDc4OTo2QTRGRjIxNiIsInZpc2l0b3JfaWQiOiIxNTgyNzU5NjYwMTIwNjk5NDE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8cc33e01da63d82db726d6690ab9734f0910bd38444109e9175f44bfb18c300a |
| hovercard-subject-tag | issue:156128380 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/K0II/JavaScript/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2567c4489a4ce3677d7bc8fd283109c0f06ee8593cd112f042808e11b8daeb55/K0II/JavaScript/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2567c4489a4ce3677d7bc8fd283109c0f06ee8593cd112f042808e11b8daeb55/K0II/JavaScript/issues/1 |
| og:image:alt | new调用函数和普通调用函数的区别(一) function test() { this.name = 'Test'; return function() { return true; } } var foo = new test(); var bar = test(); typeof foo; // function typeof bar; // function foo; // funct... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | K0II |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b98c3d9767bb8a56238a89ff8401d1cbdf3bc5c353799aacf49fe6c76b4b7c |
| turbo-cache-control | no-preview |
| go-import | github.com/K0II/JavaScript git https://github.com/K0II/JavaScript.git |
| octolytics-dimension-user_id | 19141974 |
| octolytics-dimension-user_login | K0II |
| octolytics-dimension-repository_id | 57857936 |
| octolytics-dimension-repository_nwo | K0II/JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 57857936 |
| octolytics-dimension-repository_network_root_nwo | K0II/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f7e270be010aa4de2871991025fbb97f3afe2bcb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width