const result = products.reduce((selectionData, product) => {
if (!selectors.getInUse(getState(), product)) {
if (isChecked) {
selectionData[product.id] = CHECKBOX_STATUS.CHECKED;
}
}
return selectionData;
}, {});
console.log(result);
const selectionData = {};
for (let i = 0; i < products.length; i++) {
const product = products[i];
if (!selectors.getInUse(getState(), product)) {
if (isChecked) {
selectionData[product.id] = CHECKBOX_STATUS.CHECKED;
}
}
}
console.log(result);
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
Array reduce | |
Array for |
This benchmark does not have any results yet. Be the first one to run it!