Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript object without undefined values

const buildAnObjectFromAQuery = query => (
  {  
   ...query.foo && { foo: query.foo },  
   ...query.bar && { bar: query.bar },
  }
);
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #javascript #object #undefined #values
ADD COMMENT
Topic
Name
4+8 =