X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=shallow-clone-object.mjs;h=f5c79c3bf6542e08d246b3df2012a928eef17a58;hb=bf2f087f3d30a4d8437a38b77cd0ae6f6f7da830;hp=e01a3c4f61f454b17a575dce06a1620ff6a7ab47;hpb=9fe780df3b1ec373b4fd145fad258a899320d9ac;p=benchmarks-js.git diff --git a/shallow-clone-object.mjs b/shallow-clone-object.mjs index e01a3c4..f5c79c3 100644 --- a/shallow-clone-object.mjs +++ b/shallow-clone-object.mjs @@ -9,16 +9,16 @@ const object = generateRandomObject() group(`Shallow clone object with ${Object.keys(object).length} keys`, () => { bench('Spread', () => { - const objClone = { ...object } + return { ...object } }) bench('Object assign', () => { - const objClone = Object.assign({}, object) + return Object.assign({}, object) }) bench('lodash clone', () => { - const objClone = _.clone(object) + _.clone(object) }) bench('rambda assoc', () => { - const objClone = assoc(object) + assoc(object) }) })