function cleanObject(obj) {
  return Object.keys(obj).reduce((res, prop) => {
    if (obj[prop] !== undefined) {
      res[prop] = obj[prop]
    }
    return res
  }, {})
}
/**
 * Prevent undefined properties from existing on the object
 * @param {Object} obj the source object
 * @return {Object} the clean object
 */
Prevent undefined properties from existing on the object
@param {Object} obj the source object
@return {Object} the clean object
Prevent undefined properties from existing on the object @param { Object } obj the source object @return { Object } the clean object
function cleanObject(obj) {
  return Object.keys(obj).reduce((res, prop) => {
    if (obj[prop] !== undefined) {
      res[prop] = obj[prop]
    }
    return res
  }, {})
}
function cleanObject ( obj ) { return Object . keys ( obj ) . reduce ( ( res , prop ) => { if ( obj [ prop ] !== undefined ) { res [ prop ] = obj [ prop ] } return res } , { } ) }
Prevent undefined properties from existing on the object
 @param {Object} obj the source object
 @return {Object} the clean object
Prevent undefined properties from existing on the object @param { Object } obj the source object @return { Object } the clean object