I am a javascript newbie. I have to create a var pets with an array ['cat', 'dog', 'rat'] and by using for loop I have make each strings in that array plural.
My code is:
var pets = ['cat', 'dog', 'rat'];
for (pets[i] = pets[i] + 's';) {
};
console.log(pets);
Error is:
for (pets[i] = pets[i] + 's';) {
^
Could not run: Unexpected token )
for (pets[i] = pets[i] + 's';)huh? see MDN for doc