JS - go throught a text, make array entry after each “.”

haxifix

New Member
I'm new to JavaScript. I have a text with serveral sentences and I want each sentence to be an entry in a array named sentences and alert("new entry was made"). So I have to loop through and whenever there is a "." a new entry would start. But How can I go through a text till its end?\[code\]var sentences = []var myText= "I like cars. I like pandas. I like blue. I like music."\[/code\]
 
Back
Top