Q. Which method returns the string starting at the specified position?
β
Correct Answer: (A)
substr()
Explanation: The substr() method returns the string starting at the specified position by the specified number of characters. Example:
var s = "Hello world!";
var res = str.substr(1, 3); //ell
var s = "Hello world!";
var res = str.substr(1, 3); //ell