[removed] function returning an object

前端 未结 5 1261
一个人的身影
一个人的身影 2020-12-07 08:36

I\'m taking some JavaScript/jQuery lessons at codecademy.com. Normally the lessons provide answers or hints, but for this one it doesn\'t give any help and I\'m a little con

5条回答
  •  时光取名叫无心
    2020-12-07 08:52

    The latest way to do this with ES2016 JavaScript

    let makeGamePlayer = (name, totalScore, gamesPlayed) => ({
        name,
        totalScore,
        gamesPlayed
    })
    

提交回复
热议问题