I'm using the split(' ') method in JavaScript to spilt the word for whitespaces. For example:
I have text like:
var str ="Hello this is testing" After I call
str.split(' ') Now I will get Hello this is tesing as output and when I do this
str[2] I get "l", but I want to get "testing" word (as per array index). How to convert str to array, so that if I put
str[2] //It should be testing.