Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove undefined from object js

const buildAnObjectFromAQuery = query => (
  {  
   ...query.foo && { foo: query.foo },  
   ...query.bar && { bar: query.bar },
  }
);
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #remove #undefined #object #js
ADD COMMENT
Topic
Name
6+7 =