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 two to fifth value (Not removed)
alert(fruits.slice(2,4)); //return three to quaternary value
Example Program:- (Editor)
Editor is Loading...
Advertisement
Tidak ada komentar:
Posting Komentar