TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introduction to Object-Oriented JavaScript - MDC Docs

40 pointsby willygabout 14 years ago

5 comments

gibersonabout 14 years ago
Under the section "The Property (object attribute)" the code segment has two curious lines. I expect the first cancels out the latter, making the latter useless.<p><pre><code> // in Person function this.gender = gender; // outer scope (gender will never be this value because it is overridden by the person constructor argument) Person.prototype.gender = 'Person Gender'; </code></pre> Am I correct, or does the prototype.gender line have some other purpose than instantiating gender to a value that is immediately overridden by the passed in value (or undefined if no value is passed)?
评论 #2514427 未加载
评论 #2514150 未加载
nprincigalliabout 14 years ago
Might want to check the Joose object system (<a href="http://joose.it/" rel="nofollow">http://joose.it/</a> #joose on irc.freenode.net), highly inspired in the awesome thing that Moose (<a href="http://search.cpan.org/dist/Moose/" rel="nofollow">http://search.cpan.org/dist/Moose/</a>) is to Perl. There's even a port of KiokuDB as KiokuJS!(<a href="http://joose.it/blog/2011/01/13/introducing-kiokujs/" rel="nofollow">http://joose.it/blog/2011/01/13/introducing-kiokujs/</a>) :)
clemeshaabout 14 years ago
It's good to know this stuff, but in my real-world usage of JavaScript, I've become a big fan of Backbone.js to help structure code intelligently, etc.
voidrabout 14 years ago
&#62; Inheritance A Class can inherit characteristics from another Class.<p>Somebody should tell Mozilla, that there are no classes in JavaScript....
评论 #2513547 未加载
评论 #2513526 未加载
评论 #2514443 未加载
rgbrgbabout 14 years ago
I really like Mozilla's docs. I read this one recently actually.