javascript-questions
javascript-questions copied to clipboard
Question 98 little mistake corrected
@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