console.log("January".substring(0,3)); If I want jan as the output, why is the second position in the substring 3? If I count from 0 the N in would be 2...
jan has the following indexes: 0, 1 and 2. and substring works for values lesser then (
<) the stop value (in your case 3)
Sorry, still don't understand. Why is the stop value 3?
because you want to get
jan which are at the following indexes: 0, 1 and 2
so you need a stop value of 3, because the stop value is not included
Oh, didn't realize the stop value wasn't included thanks!
that was also in my original answer, what do i need to improve upon on my first answer?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.