How do I use array destructuring instead of Array.slice()
Are there any benefits instead of slicing it?
transposed[idx] = [ 'Calendar Name', 'Standard' ]
acc.name = transposed[idx].slice(1)[0]; // => 'Standard'
const [first,second] = transposed[idx];
// first = 'Calendar Name'
// second = 'Standard'
Honestly, the way to do this is transposed[idx][1], not array destructuring or slice if all you want is the value Standard, if you're just going to drop Calendar Name on the floor anyway and not use it
const [,second] = transposed[idx];) would also work.Answer after editing the question
const arr = ["Calendar Name", "Standard"];
const [first, second] = arr;
console.log(first, second);
Answer before editing the question.
const arr = [
["Calendar Name", "Standard"],
["Valid From", 44197],
["Valid To", 44561],
["Use Holidays", "yes"],
[
"Working Day",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
],
[
"Start",
0.3333333333333333,
0.3333333333333333,
0.3333333333333333,
0.3333333333333333,
0.3333333333333333,
"-",
"-",
],
[
"End",
0.8333333333333334,
0.8333333333333334,
0.8333333333333334,
0.8333333333333334,
0.8333333333333334,
"-",
"-",
],
];
const [[first, second]] = arr;
console.log(first, second);
transposed,idx?