xxxxxxxxxx
const clean_data = datoa
.filter(({ x, y }) => {
return (
typeof x === typeof y && // filter out one string & one number
!isNaN(x) && // filter out `NaN`
!isNaN(y) &&
Math.abs(x) !== Infinity &&
Math.abs(y) !== Infinity
);
})
.map(({ x, y }) => {
return [x, y]; // we need a list of [[x1, y1], [x2, y2], ...]
});