String.prototype.trimLeft() - JavaScript | MDN Skip to main content Skip to search MDN HTML HTML: Markup language HTML reference Elements Global attributes Attributes See all… HTML guides Responsive images HTML cheatsheet Date & time formats See all… Markup languages SVG MathML XML CSS CSS: Styling language CSS reference Properties Selectors At-rules Values See all… CSS guides Box model Animations Flexbox Colors See all… Layout cookbook Column layouts Centering an element Card component See all… JavaScriptJS JavaScript: Scripting language JS reference Standard built-in objects Expressions & operators Statements & declarations Functions See all… JS guides Control flow & error handing Loops and iteration Working with objects Using classes See all… Web APIs Web APIs: Programming interfaces Web API reference File system API Fetch API Geolocation API HTML DOM API Push API Service worker API See all… Web API guides Using the Web animation API Using the Fetch API Working with the History API Using the Web speech API Using web workers All All web technology Technologies Accessibility HTTP URI Web extensions WebAssembly WebDriver See all… Topics Media Performance Privacy Security Progressive web apps Learn Learn web development Frontend developer course Getting started modules Core modules MDN Curriculum Check out the video course from Scrimba, our partner Learn HTML Structuring content with HTML module Learn CSS CSS styling basics module CSS layout module Learn JavaScript Dynamic scripting with JavaScript module Tools Discover our tools Playground HTTP Observatory Border-image generator Border-radius generator Box-shadow generator Color format converter Color mixer Shape generator About Get to know MDN better About MDN Advertise with us Community MDN on GitHub Blog Toggle sidebar Веб-технологии для разработчиков JavaScript Справочник по JavaScript Стандартные встроенные объекты String String.prototype.trimLeft() Theme OS default Light Dark Русский Remember language Learn more Deutsch English (US) Français 日本語 한국어 Português (do Brasil) Русский 中文 (简体) This page was translated from English by the community. Learn more and join the MDN Web Docs community. View in English Always switch to English String.prototype.trimLeft() Baseline Widely available This feature is well established and works across many devices and browser versions. It’s been available across browsers since январь 2020 г.. Learn more See full compatibility Не стандартно: Эта функция не стандартизирована. Мы не рекомендуем использовать нестандартные функции в действующих проектах, так как их поддержка браузерами ограничена, а поведение может измениться или быть удалено. Тем не менее, в некоторых случаях, когда нет стандартного решения, они могут быть подходящей альтернативой. In this article Сводка Синтаксис Описание Примеры Спецификации Совместимость с браузерами Смотрите также Сводка Метод trimLeft() удаляет пробельные символы с левого конца строки. Синтаксис str.trimLeft() Описание Метод trimLeft() возвращает строку с вырезанными пробельными символами с её левого конца. Метод trimLeft() не изменяет значение самой строки. Примеры Пример: использование метода trimLeft() Следующий пример покажет строку 'foo ': js var str = " foo "; console.log(str.length); // 8 str = str.trimLeft(); console.log(str.length); // 5 console.log(str); // 'foo ' Спецификации Не является частью какого-либо стандарта. Реализована в JavaScript 1.8.1. Совместимость с браузерами Enable JavaScript to view this browser compatibility table. Смотрите также String.prototype.trim() String.prototype.trimRight() Help improve MDN Was this page helpful to you? Yes No Learn how to contribute This page was last modified on 29 июн. 2026 г. by MDN contributors. View this page on GitHub • Report a problem with this content Filter sidebar Clear filter input Стандартные встроенные объекты String Конструктор String() Статические методы String.fromCharCode() String.fromCodePoint() String.raw() Методы экземпляра String.prototype.anchor() at() String.prototype.big() String.prototype.blink() String.prototype.bold() String.prototype.charAt() String.prototype.charCodeAt() String.prototype.codePointAt() String.prototype.concat() String.prototype.endsWith() String.prototype.fixed() String.prototype.fontcolor() String.prototype.fontsize() String.prototype.includes() String.prototype.indexOf() isWellFormed() String.prototype.italics() String.prototype.lastIndexOf() String.prototype.link() String.prototype.localeCompare() String.prototype.match() String.prototype.matchAll() String.prototype.normalize() String.prototype.padEnd() String.prototype.padStart() String.prototype.repeat() String.prototype.replace() String.prototype.replaceAll() String.prototype.search() String.prototype.slice() String.prototype.small() String.prototype.split() String.prototype.startsWith() String.prototype.strike() String.prototype.sub() String.prototype.substr() String.prototype.substring() String.prototype.sup() String.prototype.toLocaleLowerCase() String.prototype.toLocaleUpperCase() String.prototype.toLowerCase() String.prototype.toString() String.prototype.toUpperCase() toWellFormed() String.prototype.trim() String.prototype.trimRight() String.prototype.trimLeft() String.prototype.valueOf() String.prototype[@@iterator]() Свойства экземпляра String.length Наследование Object/Function Статические методы Function.prototype.apply() Function.prototype.bind() Function.prototype.call() Function.prototype.toString() [Symbol.hasInstance]() Статические свойства Function.displayName Function.length Function.name prototype Function.arguments Function.caller Методы экземпляра Object.prototype.__defineGetter__() Object.prototype.__defineSetter__() Object.prototype.__lookupGetter__() Object.prototype.__lookupSetter__() Object.prototype.hasOwnProperty() Object.prototype.isPrototypeOf() Object.prototype.propertyIsEnumerable() Object.prototype.toLocaleString() Object.prototype.toString() Object.prototype.valueOf() Свойства экземпляра Object.prototype.__proto__ Object.prototype.constructor MDN Your blueprint for a better internet. MDN About Blog Mozilla careers Advertise with us MDN Plus Product help Contribute MDN Community Community resources Writing guidelines MDN Discord MDN on GitHub Developers Web technologies Learn web development Guides Tutorials Glossary Hacks blog Mozilla Website Privacy Notice Telemetry Settings Legal Community Participation Guidelines Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.