I want to fill two arrays (sentences and links ) with odd and even indexes of sentence array :
Here is what I tried with no success:
let link_sentence = ">60-1> don't you worry >6-2> I gonna make sure that >16-32> tomorrow is another great day"; //
let sentence = link_sentence.split(">")
let sentences= []
let links = []
for(let i = 0; i < sentence.length; i += 2) {
sentences.push(sentence[i]);
}
console.log(sentences)
The expected output should be :
//let links = ["60-1", "6-2", "16-32"];
//let sentences = ["don't you worry", "I gonna make sure that", "tommorow is another great day"];
sentenceslooks awfully close to being correct, and you haven't even tried to computelinks.