Skip to content

Commit

Permalink
fix(curriculum): Updated function calls in hints, added backticks, cl…
Browse files Browse the repository at this point in the history
…arified pre-wrapped text handling (freeCodeCamp#58194)
  • Loading branch information
agilan11 authored Jan 17, 2025
1 parent 2387f79 commit 55ba391
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Even today, with proportional fonts and complex layouts, there are still cases w

# --instructions--

Write a function that can wrap this text to any number of characters. As an example, the text wrapped to 80 characters should look like the following:
Write a function that can wrap this text to any number of characters. Note that the input text already contains line breaks, which your function should handle appropriately. As an example, the text wrapped to 80 characters should look like the following:

<pre>
Wrap text using a more sophisticated algorithm such as the Knuth and Plass TeX
Expand All @@ -23,37 +23,37 @@ than a simple minimum length algorithm.

# --hints--

wrap should be a function.
`wrap` should be a function.

```js
assert.equal(typeof wrap, 'function');
```

wrap should return a string.
`wrap` should return a string.

```js
assert.equal(typeof wrap('abc', 10), 'string');
```

wrap(80) should return 4 lines.
`wrap(text,80)` should return 4 lines.

```js
assert(wrapped80.split('\n').length === 4);
```

Your `wrap` function should return our expected text.
Your `wrap` function should return the expected text.

```js
assert.equal(wrapped80.split('\n')[0], firstRow80);
```

wrap(42) should return 7 lines.
`wrap(text,42)` should return 7 lines.

```js
assert(wrapped42.split('\n').length === 7);
```

Your `wrap` function should return our expected text.
Your `wrap` function should return the expected text.

```js
assert.equal(wrapped42.split('\n')[0], firstRow42);
Expand Down

0 comments on commit 55ba391

Please sign in to comment.