René's URL Explorer Experiment


Title: coffeescript and javascript handle return values in constructors differently · Issue #4 · markbates/Programming-In-CoffeeScript · GitHub

Open Graph Title: coffeescript and javascript handle return values in constructors differently · Issue #4 · markbates/Programming-In-CoffeeScript

X Title: coffeescript and javascript handle return values in constructors differently · Issue #4 · markbates/Programming-In-CoffeeScript

Description: I was once under the false impression that it didn't matter what value a constructor returned with used with new as in p = new Person() But, I've told by the gurus at the node.js and coffee-script github sites that this is not so. In gen...

Open Graph Description: I was once under the false impression that it didn't matter what value a constructor returned with used with new as in p = new Person() But, I've told by the gurus at the node.js and coffee-script ...

X Description: I was once under the false impression that it didn't matter what value a constructor returned with used with new as in p = new Person() But, I've told by the gurus at the node.js and coffee...

Opengraph URL: https://github.com/markbates/Programming-In-CoffeeScript/issues/4

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"coffeescript and javascript handle return values in constructors differently","articleBody":"I was once under the false impression that it didn't matter what value a constructor returned with used with new as in  p = new Person()\n\nBut, I've told by the gurus at the node.js and coffee-script github sites that this is not so. \n\nIn general, with coffeescript it's best to use class as in:   class Person ...\n\nBut, if one tries to create a function that acts as a constructor in CoffeeScript, there is at least one gotcha.  The follow three short scripts demonstrate the problem, which apparently the writers of CoffeeScript and JavaScript will simply have to deal with. (The gurus who create/maintain these languages don't think its their problem and closed my bug report immediately.)\n\nSo, Mark, as someone who writes books on CoffeeScript, I hope the following might help you warn your readers. (BTW: like your book)\n\n```\n\n#--------------------------   person.coffee -----------------------------------\n\nPerson = (name) -\u003e\n    @name = name\n    @greet_friend = (friend) -\u003e\n        console.log(\"Hello #{friend}. My name is #{@name}.\")\n    ###\n    wierd CoffeeScript/Node.js error:\n    You will get and error if you comment the next line out\n    and explicitly return the greet_friend method above.\n    ###\n    return null\n\n\n\nPerson.prototype.hello_world =  -\u003e\n    console.log(\"#{@name} says hello world.\")\n\n\np = new Person('Fred')\np.greet_friend('Mary')\np.hello_world()\n\n#-------------------------   bad_person.coffee ---------------------\nPerson = (name) -\u003e\n    @name = name\n    @greet_friend = (friend) -\u003e\n        console.log(\"Hello #{friend}. My name is #{@name}.\")\n    ###\n    wierd CoffeeScript v1.6.1/Node.js v0.8.22 error:\n    This will bomb because we've commented out\n    the 'return null' line below, which means\n    that CoffeeScript will explicitly return\n    the greet_friend method above.\n\n    return null\n    ###\n\nPerson.prototype.hello_world =  -\u003e\n    console.log(\"#{@name} says hello world.\")\n\n\np = new Person('Fred')\np.greet_friend('Mary')\np.hello_world()\n\n#------------------- redeemed_bad_person.js -----------------------\n\n// Generated by CoffeeScript 1.6.1 \n// but modified by me. I removed the\n// explicit return of the greet_friend\n// method.\n\n(function() {\n  var Person, p;\n\n  Person = function(name) {\n    this.name = name;\n    this.greet_friend = function(friend) {\n      return console.log(\"Hello \" + friend + \". My name is \" + this.name + \".\");\n    };\n    /*\n        wierd CoffeeScript v1.6.1/Node.js v0.8.22 error:\n        This version works because we do not\n      explicitly return the greet_friend \n      method above.\n    */\n\n  };\n\n  Person.prototype.hello_world = function() {\n    return console.log(\"\" + this.name + \" says hello world.\");\n  };\n\n  p = new Person('Fred');\n\n  p.greet_friend('Mary');\n\n  p.hello_world();\n\n}).call(this);\n\n\n\n\n```\n","author":{"url":"https://github.com/fbeshears","@type":"Person","name":"fbeshears"},"datePublished":"2013-03-10T21:51:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/4/Programming-In-CoffeeScript/issues/4"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:441e116f-a9ed-89ac-aa9b-a00dbbdb983b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id95FE:41AD:116B617:172C38F:6980521E
html-safe-nonce295fc062944f286f46ed5107b9e317eace99d31424702feafe5459ef05c14659
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUZFOjQxQUQ6MTE2QjYxNzoxNzJDMzhGOjY5ODA1MjFFIiwidmlzaXRvcl9pZCI6IjkwNTY5MzM4NzgyODcwNjE1MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf7e9eadd0af20c06fbeb05988535d9257f747c141a34a8e982b9254562f8ce72
hovercard-subject-tagissue:11858253
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/markbates/Programming-In-CoffeeScript/4/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3ace46a4b467641a919127e32d5fe7392b7134042d58b65e4ac28fe7139b939d/markbates/Programming-In-CoffeeScript/issues/4
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ace46a4b467641a919127e32d5fe7392b7134042d58b65e4ac28fe7139b939d/markbates/Programming-In-CoffeeScript/issues/4
og:image:altI was once under the false impression that it didn't matter what value a constructor returned with used with new as in p = new Person() But, I've told by the gurus at the node.js and coffee-script ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefbeshears
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
go-importgithub.com/markbates/Programming-In-CoffeeScript git https://github.com/markbates/Programming-In-CoffeeScript.git
octolytics-dimension-user_id3528
octolytics-dimension-user_loginmarkbates
octolytics-dimension-repository_id2872200
octolytics-dimension-repository_nwomarkbates/Programming-In-CoffeeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id2872200
octolytics-dimension-repository_network_root_nwomarkbates/Programming-In-CoffeeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues/4#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmarkbates%2FProgramming-In-CoffeeScript%2Fissues%2F4
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmarkbates%2FProgramming-In-CoffeeScript%2Fissues%2F4
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=markbates%2FProgramming-In-CoffeeScript
Reloadhttps://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues/4
Reloadhttps://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues/4
Reloadhttps://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues/4
markbates https://patch-diff.githubusercontent.com/markbates
Programming-In-CoffeeScripthttps://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fmarkbates%2FProgramming-In-CoffeeScript
Fork 20 https://patch-diff.githubusercontent.com/login?return_to=%2Fmarkbates%2FProgramming-In-CoffeeScript
Star 62 https://patch-diff.githubusercontent.com/login?return_to=%2Fmarkbates%2FProgramming-In-CoffeeScript
Code https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript
Issues 4 https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues
Pull requests 0 https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/pulls
Actions https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/actions
Projects 0 https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/projects
Wiki https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/wiki
Security 0 https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/security
Insights https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/pulse
Code https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript
Issues https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues
Pull requests https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/pulls
Actions https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/actions
Projects https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/projects
Wiki https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/wiki
Security https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/security
Insights https://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/markbates/Programming-In-CoffeeScript/issues/4
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/markbates/Programming-In-CoffeeScript/issues/4
coffeescript and javascript handle return values in constructors differentlyhttps://patch-diff.githubusercontent.com/markbates/Programming-In-CoffeeScript/issues/4#top
https://github.com/fbeshears
https://github.com/fbeshears
fbeshearshttps://github.com/fbeshears
on Mar 10, 2013https://github.com/markbates/Programming-In-CoffeeScript/issues/4#issue-11858253
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.