var str = “Sample”;
Now you can access individual characters in a String, just like an array
alert(str); // returns ‘m’
and even apply some array functions on it.
alert(Array.prototype.join.call(str, ",") // returns S,a,m,p,l,e,
Note: While applying array functions on the String, remember that the string is behaving like read-only array. So functions that manipulate the string won’t work!
Will you give this article a +1 ? Thanks in advance