How we built it

String.prototype.padStart() / String.prototype.padEnd()

String formatting tools which returns a target/receiver string prepended or appended with a repeating pattern of characters: "foo".padStart(10, "0"); -> "0000000foo"; "foo".padEnd(10, "0"); -> "foo0000000";

Documentation

Specification

Editor's draft

Status in Chromium

Enabled by default (launch bug) in:

  • Chrome for desktop release 57
  • Chrome for Android release 57
  • Android WebView release 57
  • Opera release 44
  • Opera for Android release 44

Consensus & Standardization

  • Shipped
  • Shipped
  • Shipped
  • Positive

Owner

Last updated on 2017-01-06