Write a function called valTimesIndex which accepts an array of numbers and returns a new array with each value multiplied by the index it is at in the array: code example
Example: Write a function called valTimesIndex which accepts an array of numbers and returns a new array with each value multiplied by the index it is at in the array:
addKeyAndValue([{name: 'Elie'},{name: 'Tim'},{name: 'Elie'}], "isInstructor", true)
/*
[
{
name: 'Elie',
isInstructor: true
},
{
name: 'Tim',
isInstructor: true
},
{
name: 'Elie',
isInstructor: true
}
]
*/