{
 "compat_features": [
  "javascript.builtins.String.trimLeft",
  "javascript.builtins.String.trimRight"
 ],
 "description": "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().",
 "description_html": "The <code>trimLeft()</code> and <code>trimRight()</code> methods of strings return a new string with whitespace removed from the beginning or end of the string. They're aliases for <code>trimStart()</code> and <code>trimEnd()</code>.",
 "discouraged": {
  "according_to": [
   "https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#String.prototype.trimleft"
  ],
  "alternatives": [
   "string-trim-startend"
  ],
  "reason": "TC39 recommends using trimStart() and trimEnd() instead. The trimLeft() and trimRight() aliases are provided for compatibility with old code.",
  "reason_html": "TC39 recommends using <code>trimStart()</code> and <code>trimEnd()</code> instead. The <code>trimLeft()</code> and <code>trimRight()</code> aliases are provided for compatibility with old code."
 },
 "group": [
  "string"
 ],
 "kind": "feature",
 "name": "String trimLeft() and trimRight()",
 "spec": [
  "https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#String.prototype.trimleft"
 ],
 "status": {
  "baseline": false,
  "by_compat_key": {
   "javascript.builtins.String.trimLeft": {
    "baseline": false,
    "support": {
     "chrome": "4",
     "chrome_android": "18",
     "edge": "12",
     "firefox": "3.5",
     "firefox_android": "4",
     "safari": "5",
     "safari_ios": "4.2"
    }
   },
   "javascript.builtins.String.trimRight": {
    "baseline": false,
    "support": {
     "chrome": "4",
     "chrome_android": "18",
     "edge": "12",
     "firefox": "3.5",
     "firefox_android": "4",
     "safari": "5",
     "safari_ios": "4.2"
    }
   }
  },
  "support": {
   "chrome": "4",
   "chrome_android": "18",
   "edge": "12",
   "firefox": "3.5",
   "firefox_android": "4",
   "safari": "5",
   "safari_ios": "4.2"
  }
 },
 "id": "string-trim-leftright",
 "groups": [
  "string"
 ],
 "specs": [
  {
   "url": "https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#String.prototype.trimleft",
   "seriesComposition": "full",
   "shortname": "ecmascript",
   "series": {
    "shortname": "ecmascript",
    "currentSpecification": "ecmascript",
    "title": "ECMAScript® 2027 Language Specification",
    "shortTitle": "ECMAScript",
    "nightlyUrl": "https://tc39.es/ecma262/multipage/"
   },
   "shortTitle": "ECMAScript",
   "tests": {
    "repository": "https://github.com/tc39/test262",
    "testPaths": [
     "test"
    ],
    "excludePaths": [
     "test/intl402"
    ]
   },
   "organization": "Ecma International",
   "groups": [
    {
     "name": "TC39",
     "url": "https://tc39.es/"
    }
   ],
   "nightly": {
    "url": "https://tc39.es/ecma262/multipage/",
    "status": "Editor's Draft",
    "alternateUrls": [],
    "repository": "https://github.com/tc39/ecma262",
    "sourcePath": "spec.html",
    "pages": [
     "https://tc39.es/ecma262/multipage/scope.html",
     "https://tc39.es/ecma262/multipage/conformance.html",
     "https://tc39.es/ecma262/multipage/normative-references.html",
     "https://tc39.es/ecma262/multipage/overview.html",
     "https://tc39.es/ecma262/multipage/notational-conventions.html",
     "https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html",
     "https://tc39.es/ecma262/multipage/abstract-operations.html",
     "https://tc39.es/ecma262/multipage/syntax-directed-operations.html",
     "https://tc39.es/ecma262/multipage/executable-code-and-execution-contexts.html",
     "https://tc39.es/ecma262/multipage/ordinary-and-exotic-objects-behaviours.html",
     "https://tc39.es/ecma262/multipage/ecmascript-language-source-code.html",
     "https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html",
     "https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html",
     "https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html",
     "https://tc39.es/ecma262/multipage/ecmascript-language-functions-and-classes.html",
     "https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html",
     "https://tc39.es/ecma262/multipage/error-handling-and-language-extensions.html",
     "https://tc39.es/ecma262/multipage/ecmascript-standard-built-in-objects.html",
     "https://tc39.es/ecma262/multipage/global-object.html",
     "https://tc39.es/ecma262/multipage/fundamental-objects.html",
     "https://tc39.es/ecma262/multipage/numbers-and-dates.html",
     "https://tc39.es/ecma262/multipage/text-processing.html",
     "https://tc39.es/ecma262/multipage/indexed-collections.html",
     "https://tc39.es/ecma262/multipage/keyed-collections.html",
     "https://tc39.es/ecma262/multipage/structured-data.html",
     "https://tc39.es/ecma262/multipage/managing-memory.html",
     "https://tc39.es/ecma262/multipage/control-abstraction-objects.html",
     "https://tc39.es/ecma262/multipage/reflection.html",
     "https://tc39.es/ecma262/multipage/memory-model.html",
     "https://tc39.es/ecma262/multipage/grammar-summary.html",
     "https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html",
     "https://tc39.es/ecma262/multipage/strict-mode-of-ecmascript.html",
     "https://tc39.es/ecma262/multipage/host-layering-points.html",
     "https://tc39.es/ecma262/multipage/corrections-and-clarifications-in-ecmascript-2015-with-possible-compatibility-impact.html",
     "https://tc39.es/ecma262/multipage/additions-and-changes-that-introduce-incompatibilities-with-prior-editions.html",
     "https://tc39.es/ecma262/multipage/bibliography.html",
     "https://tc39.es/ecma262/multipage/colophon.html",
     "https://tc39.es/ecma262/multipage/copyright-and-software-license.html"
    ],
    "filename": "index.html"
   },
   "title": "ECMAScript® 2027 Language Specification",
   "source": "spec",
   "categories": [
    "browser"
   ],
   "standing": "good",
   "fragment": "String.prototype.trimleft"
  }
 ],
 "mdnUrls": [
  {
   "slug": "Web/JavaScript/Reference/Global_Objects/String/trimStart",
   "title": "String.prototype.trimStart()",
   "anchor": null,
   "url": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart"
  },
  {
   "slug": "Web/JavaScript/Reference/Global_Objects/String/trimEnd",
   "title": "String.prototype.trimEnd()",
   "anchor": null,
   "url": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd"
  }
 ],
 "standardPositions": [],
 "hasNegativeStandardPosition": false,
 "stateOfSurveys": [],
 "chromeUseCounters": {},
 "interop": [],
 "wpt": null,
 "developerSignals": null,
 "bugs": {},
 "useCases": null,
 "baselineLowDateAsObject": null,
 "baselineHighDateAsObject": null
}