javascript-questions icon indicating copy to clipboard operation
javascript-questions copied to clipboard

Question 98 little mistake corrected

Open Alireza29675 opened this issue 5 years ago • 2 comments

Alireza29675 avatar Dec 21 '20 17:12 Alireza29675

@jakeherp would this be more appropriate?

const getList = ([x, ...y]) => [x, y]

const list = [1, 2, 3, 4]
console.log(getList(list))

const getUser = user => { name: user.name, age: user.age }

const user = { name: "Lydia", age: 21 }
console.log(getUser(user))

Answer A: [1, [2, 3, 4]] and SyntaxError

raduflp avatar Jan 16 '21 12:01 raduflp