← Back to release summary

String.prototype.trimStart / String.prototype.trimEnd

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 66)
Intent stage
None

Summary

Until now, String.prototype.{trimLeft,trimRight} were non-standard language extensions, required for Web compatibility. The Stage 3 proposal at https://github.com/tc39/proposal-string-left-right-trim standardizes this functionality as String.prototype.{trimStart,trimEnd}, and defines String.prototype.{trimLeft,trimRight} as aliases for backwards compatibility. This patch implements that proposal behind the --harmony-string-trimming flag.

Standards & signals

View on chromestatus.com