Answers for "conditional json spread operator"

0

conditional json spread operator

const buildAnObjectFromAQuery = query => ({
  ...query.foo && { foo: query.foo },
  ...query.bar && { bar: query.bar },
});
Posted by: Guest on August-16-2021

Code answers related to "conditional json spread operator"

Code answers related to "Javascript"

Browse Popular Code Answers by Language