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

15th
Nov 2015
Dylan Pagillo
@DylanNeil
Nov 15 2015 05:28
hint
CamperBot
@camperbot
Nov 15 2015 05:28
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Dylan Pagillo
@DylanNeil
Nov 15 2015 05:29
hint
CamperBot
@camperbot
Nov 15 2015 05:29

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]

Dylan Pagillo
@DylanNeil
Nov 15 2015 05:29
hint
CamperBot
@camperbot
Nov 15 2015 05:29

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]

Dylan Pagillo
@DylanNeil
Nov 15 2015 05:39
hint
hint
CamperBot
@camperbot
Nov 15 2015 05:39

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]

These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Dylan Pagillo
@DylanNeil
Nov 15 2015 05:39
hint
CamperBot
@camperbot
Nov 15 2015 05:39

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]

Dylan Pagillo
@DylanNeil
Nov 15 2015 05:40
hint
CamperBot
@camperbot
Nov 15 2015 05:40
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Dylan Pagillo
@DylanNeil
Nov 15 2015 05:40
hint
CamperBot
@camperbot
Nov 15 2015 05:40

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]

Dylan Pagillo
@DylanNeil
Nov 15 2015 05:40
hint
CamperBot
@camperbot
Nov 15 2015 05:40

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]