Closed Bug 1347496 Opened 4 years ago Closed 6 months ago

Inaccurate information in a code snippet

Categories

(Developer Documentation Graveyard :: JavaScript, enhancement, P5)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: regspam, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

The code snippet in the "Custom Object" section, right before the "Inner functions" subsection is:

function lastNameCaps() {
  return this.last.toUpperCase();
}
var s = new Person('Simon', 'Willison');
lastNameCaps.call(s);
// Is the same as:
s.lastNameCaps = lastNameCaps;
s.lastNameCaps();

However "lastNameCaps.call(s)" is not quite the same as "s.lastNameCaps = lastNameCaps; s.lastNameCaps();", because in the former case "s" doesn't get the "lastNameCaps" property.
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 6 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.