Test name | Executions per second |
---|---|
vanilla | 6137087.0 Ops/sec |
proxy | 4621869.0 Ops/sec |
object = {
variant: data => ({
variant: data
})
};
proxy = new Proxy({}, {
get(target, prop) {
return data => ({
[prop]: data
})
}
})
object.variant("data")
proxy.variant("data")