javascript-tutorial / javascript-tutorial/en.javascript.info

Page: Decorators and forwarding, call/apply

Open
#2,983 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
25.5k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Decorators and forwarding, call/apply
https://javascript.info/call-apply-decorators

Problem
I've discussed the confusion involving this page of the tutorial with Joseph on the discord server. The call and apply function prototype methods should be introduced on their own before touching on the topic of decorators or caches. The comments on this page are also unanimous in describing the content as confusing.

Possible Solutions

Page Title
Joseph proposed a title change to something like "Wrapper functions and call, apply methods". I agree that the title is misleading or poorly worded. Perhaps it should follow the pattern of the other pages' titles in the Advanced working with functions section:

The apply and call methods

Page Content
I believe the content should be rearranged so that discussion of how the apply and call methods work comes first. The topics of decorators and transparent caching can follow afterwards. There are many uses for these methods, so it's a bit confusing to introduce them as a means to write decorators.

Links
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call

I'll try to get Joseph to chime in if possible.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked tutorial page and compare its explanation of call/apply, decorators, and transparent caching with the linked MDN references. Done means the title is clearer and the page introduces call/apply before decorators and caching, with the revised order reflected in the tutorial.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.