substring
(MDN) takes parameters as (from, to)
.
substr
(MDN) takes parameters as (from, length)
.
Update: MDN considers substr
legacy.
alert("abc".substr(1,2)); // returns "bc"
alert("abc".substring(1,2)); // returns "b"
You can remember substring
(with an i) takes indices, as does yet another string extraction method, slice (with an i).
When starting from 0 you can use either method.