Skip to content

Instantly share code, notes, and snippets.

@rrmdn
Last active February 7, 2017 01:37
Show Gist options
  • Select an option

  • Save rrmdn/a422de7f7e393206dece21f334093568 to your computer and use it in GitHub Desktop.

Select an option

Save rrmdn/a422de7f7e393206dece21f334093568 to your computer and use it in GitHub Desktop.
const availableProducts = products.filter(product => (
(product && product.quantity !== 0) &&
(product && product.metadata && product.metadata.status && product.metadata.status === 'good')
));
const damagedProducts = products.filter(product => (
(product && product.quantity !== 0) &&
(product && product.metadata && product.metadata.status && product.metadata.status === 'damaged')
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment