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

19th
Oct 2015
Reinaldo Díaz Lugo
@reinaldo122
Oct 19 2015 04:46
hint
CamperBot
@camperbot
Oct 19 2015 04:46
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Joenald Pasion
@joenald
Oct 19 2015 18:13
hint
CamperBot
@camperbot
Oct 19 2015 18:13

hint [1/2]

## :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]

Joenald Pasion
@joenald
Oct 19 2015 18:13
hint
CamperBot
@camperbot
Oct 19 2015 18:13

hint [2/2]

Hi everyone,

There is an issue with "Bonfire:Truncate a String".
First heres the code:

    function truncate(str, num) {
  var truncd = '';
  if (str.length > num) {
    truncd = str.slice(0, num - 3) + '...';
    return truncd;
  }

  return str;
}
truncate("A-tisket a-tasket A green and yellow basket", 1, "");

It should not pass the first test that is
"A-tisket a-tasket A green and yellow basket", 1 should return "A-tisket..."

According to this test the console should shoe "A-tisket..."but the console says"A-tisket a-tasket A green and yellow bask..."

but to my surprise it still passed... I hope I will get an explaination to this

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

Lloyd
@rockymountaintech
Oct 19 2015 20:20
hint
CamperBot
@camperbot
Oct 19 2015 20:20
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Lloyd
@rockymountaintech
Oct 19 2015 20:20
bf Truncate a string
CamperBot
@camperbot
Oct 19 2015 20:20

: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

Lloyd
@rockymountaintech
Oct 19 2015 20:20
hint
CamperBot
@camperbot
Oct 19 2015 20:20

hint [1/2]

## :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]

Lloyd
@rockymountaintech
Oct 19 2015 20:20
hint
CamperBot
@camperbot
Oct 19 2015 20:20

hint [2/2]

Hi everyone,

There is an issue with "Bonfire:Truncate a String".
First heres the code:

    function truncate(str, num) {
  var truncd = '';
  if (str.length > num) {
    truncd = str.slice(0, num - 3) + '...';
    return truncd;
  }

  return str;
}
truncate("A-tisket a-tasket A green and yellow basket", 1, "");

It should not pass the first test that is
"A-tisket a-tasket A green and yellow basket", 1 should return "A-tisket..."

According to this test the console should shoe "A-tisket..."but the console says"A-tisket a-tasket A green and yellow bask..."

but to my surprise it still passed... I hope I will get an explaination to this

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

Lloyd
@rockymountaintech
Oct 19 2015 20:24
hint
CamperBot
@camperbot
Oct 19 2015 20:24
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Lloyd
@rockymountaintech
Oct 19 2015 20:49
hint
CamperBot
@camperbot
Oct 19 2015 20:49

hint [1/2]

## :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]

Lloyd
@rockymountaintech
Oct 19 2015 20:49
hint
CamperBot
@camperbot
Oct 19 2015 20:49

hint [2/2]

Hi everyone,

There is an issue with "Bonfire:Truncate a String".
First heres the code:

    function truncate(str, num) {
  var truncd = '';
  if (str.length > num) {
    truncd = str.slice(0, num - 3) + '...';
    return truncd;
  }

  return str;
}
truncate("A-tisket a-tasket A green and yellow basket", 1, "");

It should not pass the first test that is
"A-tisket a-tasket A green and yellow basket", 1 should return "A-tisket..."

According to this test the console should shoe "A-tisket..."but the console says"A-tisket a-tasket A green and yellow bask..."

but to my surprise it still passed... I hope I will get an explaination to this

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

Javier Sanchez
@javiermxmd
Oct 19 2015 23:10
boo who hint
hint Boo who
CamperBot
@camperbot
Oct 19 2015 23:10
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page