How to convert this:
const array = [10, 0, 90, 80, 50, 0, 60];
let id = 1;
const studentScores = array.map(function(score, index){
return { [index]: score, student_id: id }
});
console.log(studentScores)
Into fat arrow syntax:
const studentScores = array.map((score, index) => { [index]: score, student_id: id } );
My try throws an error:
SyntaxError: Unexpected token :