(function shuffle () {
cards.forEach(card => {
let randomPos = Math.floor(Math.random() * 12)
card.style.order = randomPos
})
})();
import xlsx from "xlsx";
// const { files } = _thisState;
const reader = new FileReader();
reader.onload = () => {
const data = reader.result;
const workbook = xlsx.read(data, { type: "array" });
const sheetName = workbook.SheetNames[0];
const sheet = workbook.Sheets[sheetName];
const sheetData = xlsx.utils.sheet_to_json(sheet, { header: 1 });
const newList = sheetData
.filter(row => row[0])
.map(row => ({
MATNR: row[0],
MENGE: row[1],
MEINS: row[2]
}));
// http request...
};
reader.readAsArrayBuffer(files[0]);
🔗 xlsx