I have two arrays, one with objects containing multiple attributes:
var peopleArray = [{name: 'James', lastname: 'Stanley'}, {name: 'Roger', lastname 'Moore'}];
And one array with random words:
var wordArray = ['Banana', 'Sword'];
My goal is to add each word from wordArray as a new attribute to each object in peopleArray based on index.
E.g. the word "Banana" is at index 0 in wordArray so it will be added to the object at the same index in peopleArray, which is "James".
I hope it was clear, any guidance in any way appreciated! I really don't know how to achieve this