JSFiddle - React, Tailwind, and code Playground
JavaScript
const fails = () => {
const x = {
0: 'help',
length: 1
};
const y = [x].map(Array.from); // will throw an Error
return y;
};
const works = () => {
const x = {
0: 'help',
length: 1
};
const y = [x].map(item => Array.from(item)); // will work
return y;
};
console.log(works());
console.log(fails());