diff --git a/benchmark/url/url-searchparams-toString.js b/benchmark/url/url-searchparams-toString.js index cc2cbfc12bb416..04551d19659129 100644 --- a/benchmark/url/url-searchparams-toString.js +++ b/benchmark/url/url-searchparams-toString.js @@ -35,8 +35,9 @@ function paramGenerator(paramType) { case 'string': // Return the values object with all values as strings return valueKeys.reduce((acc, key) => { - acc[key] = Object.keys(values[key]).reduce((acc, k, i) => { - acc += `${k}=${values[key][k]}${i < valueKeys.length - 1 ? '&' : ''}`; + const objectKeys = Object.keys(values[key]); + acc[key] = objectKeys.reduce((acc, k, i) => { + acc += `${k}=${values[key][k]}${i < objectKeys.length - 1 ? '&' : ''}`; return acc; }, ''); return acc;