var string = "Сидел в траве кузнечик.Совсем как огуречик зелёненький.";
var sentences = [];
var dotIndex = -1;
do {
var startIndex = dotIndex + 1;
dotIndex = string.indexOf('.', startIndex);
var endIndex = dotIndex > -1 ? dotIndex : Infinity;
var sentence = string.substring(startIndex, endIndex);
if (sentence)
sentences.push(sentence);
} while (dotIndex > -1);
var result = [];
for (var i = 0; i < sentences.length; i++) {
var words = sentences[i].split(' ');
result.push(words.slice(0, -2));
}
alert(result);