Limited Strings

String trimLeft() and trimRight()

The trimLeft() and trimRight() methods of strings return a new string with whitespace removed from the beginning or end of the string. They're aliases for trimStart() and trimEnd().

Baseline Status
Limited
Missing ≥1 target
First Core Launch
Firefox 3.5
2009-06-30
Core-3 Stability
342d
Last: Safari (2010-06-07)
BCD Keys Mapped
2
Group: Strings

Browser Support Timeline

Firefox v3.5 (2009-06-30) Chrome v4 (2010-01-25) Safari v5 (2010-06-07) Safari on iOS v4.2 (2010-11-22) Firefox for Android v4 (2011-03-29) Chrome Android v18 (2012-06-27) Edge v12 (2015-07-29)
Green dot marks the first browser release (2009-06-30); blue dots show subsequent browser launches (+2220d total span).

Browser Support Releases

BrowserTypeVersionRelease Date
Firefox desktop 3.5 2009-06-30
Chrome desktop 4 2010-01-25
Safari desktop 5 2010-06-07
Safari on iOS mobile 4.2 2010-11-22
Firefox for Android mobile 4 2011-03-29
Chrome Android mobile 18 2012-06-27
Edge desktop 12 2015-07-29

Constituent MDN BCD Keys (Sample)

BCD KeyAreaCore-3 TTA
javascript.builtins.String.trimLeft JS 342d
javascript.builtins.String.trimRight JS 342d