Giter Club home page Giter Club logo

Comments (2)

chrisdavidmills avatar chrisdavidmills commented on August 25, 2024

Hi there,

It sounds to me like there is some kind of error in your code. Either you have misread an instruction, or made a typo. It is useful for me to explore what went wrong, as there is always scope for me to make my instructions clearer.

So, first of all, check your code against the finished version on our repo:

I've tried running

Teacher.prototype = Object.create(Person.prototype);

in the console on this page, and it works as expected. Also, the functions are contained on the prototype inside properties, rather than being hung off the prototype directly, so you'll have more luck with Person.prototype.greeting and Teacher.prototype.greeting (no parentheses).

If you still have trouble, feel free to throw me your code source, and I'll have a look and see what the trouble is.

from learning-area.

bluevoxInc avatar bluevoxInc commented on August 25, 2024

I tried both the source code and live versions in Firefox and Chrome browsers. When I run:
Object.getOwnPropertyNames(Teacher.prototype);
I only see:
Array [ "constructor", "greeting" ]

But I can query all the function definitions when I make the calls without parenthesis. In retrospect, I guess it doesn't make sense to execute a function against its prototype, only on its instance. Tried this on teacher1 and everything worked fine.

Thanks for your help!

from learning-area.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.