No description
Find a file
Mustafa Kemal Tuna 7d0d65478d
clarifying example code
An interesting question may arise in the example above: what’s the value of this inside set fullName(value)? Where are the properties this.name and this.surname written: into user or admin?

The answer is simple: this is not affected by prototypes at all.

No matter where the method is found: in an object or its prototype. In a method call, this is always the object before the dot.

So, the setter call admin.fullName= uses admin as this, not user.

That is actually a super-important thing, because we may have a big object with many methods, and have objects that inherit from it. And when the inheriting objects run the inherited methods, they will modify only their own states, not the state of the big object.

The example code doesn't show these concepts. Also, these additions can make readers ask questions before the explanation of the example code.
2020-07-25 05:38:45 +03:00
1-js clarifying example code 2020-07-25 05:38:45 +03:00
2-ui Merge pull request #1989 from siddharth-golchha/patch-1 2020-07-18 14:11:28 +03:00
3-frames-and-windows Correct message in sandbox.view iframe 2020-07-07 13:02:50 +03:00
4-binary Update article.md 2020-04-09 11:29:51 +08:00
5-network Merge pull request #1972 from dvdvdmt/patch-1 2020-07-18 14:16:21 +03:00
6-data-storage Browser LocalStorage capacity updated to 5 MB. 2020-07-17 21:40:25 +05:30
7-animation Update task.md 2020-05-16 00:19:22 -03:00
8-web-components Merge pull request #1691 from ogaclejapan/fix-incorrect-method-call 2019-12-27 09:09:35 +03:00
9-regular-expressions minor fixes 2020-07-05 12:45:21 +03:00
script renovations 2015-02-21 14:58:02 +03:00
.gitattributes minor 2019-07-29 17:02:31 +03:00
.gitignore minor 2015-03-15 15:29:15 +03:00
AUTHORING.md translate 2019-04-14 17:09:15 +03:00
changes.sketch renovations 2015-04-05 23:59:54 +03:00
css.md css 2019-06-14 09:25:50 +03:00
figures.sketch minor fixes 2020-05-06 23:36:02 +03:00
LICENSE.md Update LICENSE.md 2019-07-16 13:19:28 +03:00
README.md Update README.md 2019-06-14 09:29:46 +03:00
todo.md minor 2019-04-10 10:53:34 +03:00

The Modern JavaScript Tutorial

This repository hosts the English content of the Modern JavaScript Tutorial, published at https://javascript.info.

Translations

We'd like to make the tutorial available in many languages. Please help us to translate.

See https://javascript.info/translate for the details.

Contributions

We'd also like to collaborate on the tutorial with other people.

Something's wrong? A topic is missing? Explain it to people, add as PR 👏

You can edit the text in any editor. The tutorial uses enhanced "markdown" format, easy to grasp. And if you want to see how it looks on-site, there's a server to run the tutorial locally at https://github.com/javascript-tutorial/server.

The list of contributors is available at https://javascript.info/about#contributors.

Structure

Every chapter, article or a task has its folder.

The folder is named like N-url, where N is a number for the sorting purposes and url is the URL part with title of the material.

The type of the material is defined by the file inside the folder:

  • index.md stands for a chapter
  • article.md stands for an article
  • task.md stands for a task (solution must be provided in solution.md file aswell)

Each of these files starts from the # Main header.

It's very easy to add something new.



Ilya Kantor @iliakan