-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Description
MDN URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
What specific section or headline is this issue about?
Article title
What information was incorrect, unhelpful, or incomplete?
The properties of Function instances (length and name, and I guess the deprecated/nonstandard arguments, caller, and displayName) are named as properties of the Function constructor (e.g., Function.length). While it is true that, as a Function itself, the Function constructor has constant length and name properties, they are also present on all Function instances.
I think it is misleading to title these properties as Function.length, etc.—this naming implies that they are present only on the Function constructor rather than Function intsances. It is also inconsistent with how other objects treat their instance properties—e.g., Array.prototype.length.
What did you expect to see?
I expected to see these properties titled Function.prototype.length, Function.prototype.name, etc. Although length and name are not strictly speaking inherited from Function.prototype, this situation is little different from “exotic” properties on exotic objects, such as Array.prototype.length. It’s less misleading to distinguish them as instance objects using Function.prototype.
Do you have any supporting links, references, or citations?
Links to sections in Ecma262 are given above.
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/javascript/reference/global_objects/function - MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/javascript/reference/global_objects/function/index.md
- Last commit: 85e526f
- Document last modified: 2022-06-27T06:55:54.000Z