My state contains the following property:
sentences: [
{
text: "Go away and hide behind that door where we found you just now.",
grade: 606
},
{
text: "Please don't let anyone spoil these nice fresh flowers.",
grade: 609
},
]
Now I am trying to iterate over the sentences, create a new property on each sentence called words which will be an array of words. When I console.log(this.sentences), I see the new property but when I try to render the property in the DOM, it doesn't show the new property.
mounted(){
this.sentences.map((sentence) => {
const arrayOfWords = sentence.text.split(' ');
sentence.words = arrayOfWords
})
console.log(this.sentences)
}