Skip to content

Conversation

@mao-sz
Copy link
Contributor

@mao-sz mao-sz commented Nov 18, 2025

Because

Superseding #29465 due to inactivity.

The topic of constructors and prototypes is a common pain point amongst learners. The most common confusions are the differences between [[Prototype]], .prototype and .__proto__ and similar, as well as exactly what the lesson is referring to when it just uses the word prototype.

There was also a section with incorrect info (.[[Prototype]] is not valid JS - [[Prototype]] has a different use).

This PR

  • Removes incorrect content about [[Prototype]]
  • Uses [[Prototype]] syntax instead of just prototype specifically when the lesson is referring to an object's internal prototype.
  • Adds notes box clarifying difference between Object.getPrototypeOf() and .prototype
  • Wraps similar neighbouring section in a note box
  • Fixes accessibility of link text label

Issue

Closes #28633

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

Existing explanation was incorrect - `.[[Prototype]]` is not valid JS
syntax. `[[Prototype]]` is just another way to refer to the internal
prototype in text.

Link text label made sufficiently accessible on its own.
Common syntax in docs and clearer distinction from
`Function.prototype.prototype`
Very common confusion that .prototype is for accessing [[Prototype]]
@github-actions github-actions bot added the Content: JavaScript Involves the JavaScript course label Nov 18, 2025

1. [JavaScript Tutorial's article on the `this` keyword](https://www.javascripttutorial.net/javascript-this/) covers how `this` changes in various situations. Pay special attention to the pitfalls mentioned in each section.
1. You might have noticed us using the `this` keyword in object constructors and prototype methods in the examples above. [JavaScript Tutorial's article on the `this` keyword](https://www.javascripttutorial.net/javascript-this/) covers how `this` changes in various situations. Pay special attention to the pitfalls mentioned in each section.
1. Read the article [`[[Prototype]]` vs `__proto__` vs `.prototype` in JavaScript](https://medium.com/@eamonocallaghan/prototype-vs-proto-vs-prototype-in-javascript-6758cadcbae8)
Copy link
Contributor Author

@mao-sz mao-sz Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading through this assignment (https://medium.com/@eamonocallaghan/prototype-vs-proto-vs-prototype-in-javascript-6758cadcbae8) and accounting for the content changes in this PR, I'm wondering if this assignment is needed? I feel like it can be dropped alongside the other changes.

@mao-sz mao-sz requested review from a team and bycdiaz and removed request for a team November 18, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content: JavaScript Involves the JavaScript course

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Objects and Object Constructors: setPrototypeOf() not explained properly

1 participant