Tests:
  • Array reduce

    AخA
     
    const result = products.reduce((selectionData, product) => {
                if (!selectors.getInUse(getState(), product)) {
                    if (isChecked) {
                        selectionData[product.id] = CHECKBOX_STATUS.CHECKED;
                    }
                }
                return selectionData;
            }, {});
    console.log(result);
  • Array for

    x
     
    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);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array reduce
    Array for

    Fastest: N/A

    Slowest: N/A

Latest run results:

No previous run results

This benchmark does not have any results yet. Be the first one to run it!