Skip to content

Chapter - Prorotype Methods #3408

@IMTanuki

Description

@IMTanuki

In the first section. your reference to 'prototype' is confusing and, if I understand the concept correctly, incorrect:

let animal = {
  eats: true
};

// create a new object with animal as a **prototype**
let rabbit = Object.create(animal); // same as {__proto__: animal}

In this example:

  • rabbit's [[Prototype]] property is set to animal

It's unfortunate that the JS specification used the same word for two different concepts, b/c I think even experts like you guys occasionally conflate the two terms.

Am I missing sth?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions