Skip to content

Name of String.padStart's maxLength parameter is misleading #63503

@youngspe

Description

@youngspe

⚙ Compilation target

ESNext

⚙ Library

ESNext

Missing / Incorrect Definition

Applies to both String.prototype.padStart and String.prototype.padEnd:

The name of the maxLength parameter suggests that's the maximum length of the returned string, when it's actually the minimum length of the returned string. MDN uses targetLength for the names of these parameters.

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions