23.Substring bug? i need help


#1

// Use console.log( ) to print out the substrings.
// Here is an example of the 1st to 4th letter of "JavaScript":
// console.log("JavaScript".substring(0,4));

console.log("January".substring(0,3));
console.log("Melbourne is great".substring(0,12));
console.log("hamburgers".substring(3,9));


#2

I'm not sure what problem it is that you're having here, but one thing to remember about how string.substring(start, end) works is that the 'start' value is inclusive, and the 'end' value is non-inclusive. In addition, the index always starts at 0.

"abcde".substring(1,5) will result in "bcde".

"abcde".substring(0,4) will result in "abcd"


#3

your numbers might be too long. Remember that the first letter is 0 and not 1


#4

hi
am having the same issue. how did you solve the problem


#5

the code that worked for me had:
console.log("Hamburgers".substring(3, 10));

hope that helped.