slice() method for string values
Syntax
string.slice(startindex[,endindex]);
endindex is the optional.
Example :
var fruits = ["Jan", "Feb", "Mar", "Apr", "May"];
alert(fruits.slice(1)); //return 2 to 5th value (Not removed)
alert(fruits.slice(2,4)); //return 3 to 4th value
Example Program:- (Editor)
Editor is Loading...
Advertisement
0 nhận xét:
Đăng nhận xét