---
id: 68e4276483b0c71658aab1ce
title: Step 6
challengeType: 1
dashedName: step-6
---

# --description--

There will be times where you will want to only trim whitespace at the beginning of the string. That is where the `trimStart()` method comes in handy.

Here is an example:

```js
const sentence = "  I love learning.  ";
sentence.trimStart(); // "I love learning.  "
```

Remember that strings are immutable. This method will create a new string with the result. Not modify the original one.

Create a variable `trimmedStart` and assign it the result of using the `trimStart()` method on the `userInput` variable.

# --hints--

You should have a `trimmedStart` variable.

```js
assert.exists(trimmedStart);
```

Your `trimmedStart` variable should be a string.

```js
assert.isString(trimmedStart);
```

You should assign `userInput.trimStart()` to your `trimmedStart` variable.

```js
assert.equal(trimmedStart, userInput.trimStart());
```

# --seed--

## --seed-contents--

```js
const userInput = "   Hello World!   ";
console.log("Original input:");
console.log(userInput);

const cleanedInput = userInput.trim();
console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
--fcc-editable-region--

--fcc-editable-region--
```
