These are chat archives for camperbot/bonfire-truncate-a-string

11th
Dec 2015
Zachary Ryals
@ZachRyals
Dec 11 2015 05:19
bonfire <truncate a string>
CamperBot
@camperbot
Dec 11 2015 05:19

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

Zachary Ryals
@ZachRyals
Dec 11 2015 05:19
hint
CamperBot
@camperbot
Dec 11 2015 05:19

hint [1/7]

## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Zachary Ryals
@ZachRyals
Dec 11 2015 05:21
bf details
CamperBot
@camperbot
Dec 11 2015 05:21

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.
Note that the three dots at the end add to the string length.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links: