Missing letters - Slice not returning result

Missing letters - Slice not returning result
0

Tell us what’s happening:
I’m using slice and expecting the result to be newword = “stuvwx”. However i’m getting newword = " " instead. Why am i getting an empty string?

Your code so far


var word = "abcdefghijklmnopqrstuvwxyz";
var newword = word.slice(18,6);
console.log(newword);

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/missing-letters/

Take a close look at what the parameters of the slice() function are:

1 Like

I got it. It was a basic mistake. Thank you for your help.