Bug with "More substring practice"


#1


No error. It somehow count from 1, not from 0.Or I don't understand something?
console.log("January".substring(0,3));
console.log("Melbourne is great".substring(0,12));
console.log("Hamburgers".substring(3,10));
Show:
"Jan"
"Melbourne is"
"burgers"


#2

January (j = 0, a = 1, n = 2) and melbourne is great both start counting from zero. The first letter of a string is at index 0


#3

January (j = 0, a = 1, n = 2, u = 3), yes, so why it's not "janu" if substring(0,3)?


#4

I found answer, thanks. =)


#5

that i could not deduce from your question, it is lesser then 3, so 0,1,2


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.