News for hackers. Stuff that matters.
Re:Sparse Array Destructuring in JavaScript by kamranjon on Wednesday November 16, 2022 @11:52PM (#33635115)
Unfortunately eslint would likely flag this as unused vars, so typically you would not do this as you've described. Object destructuring is a bit more forgiving and can be a nice alternative: const {id, name} = loadUserInfo() - assuming you wrote loadUserInfo and are in control of the return value.
Re:Sparse Array Destructuring in JavaScript by artdigital on Thursday November 17, 2022 @12:05AM (#33635187)
You can easily add a rule to eslint that makes it not complain _xxx for unused variables: https://eslint.org/docs/latest/rules/no-unused-vars#argsigno...