JavaScript: String.prototype.substr

By Xah Lee. Date: . Last updated: .
str.substr(index, length)
Return a substring of length length, starting at index
console.log( "abcd".substr(1,2) === "bc" ); // true
console.log( "abcd".substr(1, 9) === "bcd" ); // true
// length longer than available, take to the end instead

JS substring

JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

String

prototype