Skip to content

Bug in example of use of getter/setter methods in JavaScript "using classes" guide #42059

@ye10dux

Description

@ye10dux

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_classes#private_fields

What specific section or headline is this issue about?

Private Fields

What information was incorrect, unhelpful, or incomplete?

Text describes abstracting implementation, gives example against using values[0] in favour of getRed/setRed. Constructor sets values from rgbToHSL but getRed/setRed still use values[0]

What did you expect to see?

Implementation of getRed/setRed should be in terms of hslToRGB

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions